Click here to Skip to main content
15,913,722 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to do Client side validation when hyperlink click Pin
sanpune28-Nov-08 18:51
sanpune28-Nov-08 18:51 
GeneralRe: How to do Client side validation when hyperlink click Pin
Christian Graus28-Nov-08 19:05
protectorChristian Graus28-Nov-08 19:05 
Questionlink Button in Gridview Pin
kishorg128-Nov-08 18:07
kishorg128-Nov-08 18:07 
AnswerRe: link Button in Gridview Pin
Christian Graus28-Nov-08 18:29
protectorChristian Graus28-Nov-08 18:29 
AnswerRe: link Button in Gridview Pin
kishorg130-Nov-08 22:33
kishorg130-Nov-08 22:33 
Questioni need help Pin
njote28-Nov-08 17:15
njote28-Nov-08 17:15 
AnswerRe: i need help Pin
Christian Graus28-Nov-08 17:19
protectorChristian Graus28-Nov-08 17:19 
GeneralRe: i need help Pin
njote28-Nov-08 17:40
njote28-Nov-08 17:40 
GeneralRe: i need help Pin
Christian Graus28-Nov-08 17:45
protectorChristian Graus28-Nov-08 17:45 
GeneralRe: i need help Pin
njote28-Nov-08 18:01
njote28-Nov-08 18:01 
GeneralRe: i need help Pin
Christian Graus28-Nov-08 18:21
protectorChristian Graus28-Nov-08 18:21 
Questionvisual studio 2008 Pin
ahawari0928-Nov-08 8:20
ahawari0928-Nov-08 8:20 
AnswerRe: visual studio 2008 Pin
Christian Graus28-Nov-08 15:58
protectorChristian Graus28-Nov-08 15:58 
AnswerRe: visual studio 2008 Pin
Abhijit Jana28-Nov-08 19:50
professionalAbhijit Jana28-Nov-08 19:50 
Questionhow to bind value to select element using Ajax Pin
Exelioindia28-Nov-08 5:32
Exelioindia28-Nov-08 5:32 
AnswerRe: how to bind value to select element using Ajax Pin
Christian Graus28-Nov-08 16:02
protectorChristian Graus28-Nov-08 16:02 
GeneralRe: how to bind value to select element using Ajax Pin
Exelioindia30-Nov-08 23:18
Exelioindia30-Nov-08 23:18 
QuestionCode jumps from one place to the other unexpectadly with Firefox!! Pin
Talal Sultan28-Nov-08 5:15
Talal Sultan28-Nov-08 5:15 
QuestionGridview and Group Email Problem Pin
bruhol28-Nov-08 5:03
bruhol28-Nov-08 5:03 
AnswerRe: Gridview and Group Email Problem Pin
Ashfield28-Nov-08 8:56
Ashfield28-Nov-08 8:56 
GeneralRe: Gridview and Group Email Problem Pin
bruhol30-Nov-08 10:36
bruhol30-Nov-08 10:36 
QuestionAdd Controls to a view control programmatically Pin
anto200528-Nov-08 3:38
anto200528-Nov-08 3:38 
Hi,
I'm developing a web page - asp.net ( .net 3.5 - visual studio 2008 ) :

This is my idea :
I need to add Controls to a web form page programmatically (labels, textboxes, ect..)

Controls must be grouped into "Sections".
I Inserted a Multiview onto my page.
When I load the page, I retrieve information about controls in a database.
Then I create a view and add it to multiview control and so add controls to each view.
Now I want display my "sections" like tab strips :

My code (more or less) :

protected void Page_PreInit(Object sender, EventArgs e)
{
if (!IsPostBack)
{
ChargeControls();
this.MultiViewSections.ActiveViewIndex = 0;
}
}

private void ChargeControls()
{

read database table

for each record


(example)
...

viewSection = new View();
viewSection.ID = "Section" ;
int indexSection = 0 ;
...

label = new Label();
label.ID = "lblSection" ;
label.Text = "text Section";
this.MultiViewSections.Views[indexSection].Controls.Add(label);

...

}


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs"

Inherits="WebApplication.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:MultiView ID="MultiViewSections" runat="server">
</asp:MultiView>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="Default.aspx">Home

page</asp:HyperLink>
</form>
</body>
</html>


I can see first view
( this.MultiViewSections.ActiveViewIndex = 0; ).
But I can't navigate to others views , I get this error :
ActiveViewIndex is being set to '0'. It must be smaller than the current number of View

controls '0'.
For dynamically added views, make sure they are added before or in Page_PreInit event.

Parameter name: value


I inserted two buttons onto the page and I try to use these instructions :
NextView/PrevView , SwitchViewByID, MultiView1.ActiveViewIndex += 1 / -= 1 .
No result!

what's wrong ?
Thanks in advance .

p.s.
A MultiView control is a good choice in this situation ?
AnswerRe: Add Controls to a view control programmatically Pin
Christian Graus28-Nov-08 16:04
protectorChristian Graus28-Nov-08 16:04 
Questiondropdownlist selected index change problem Pin
lakshmichawala28-Nov-08 2:33
lakshmichawala28-Nov-08 2:33 
AnswerRe: dropdownlist selected index change problem Pin
NeverHeardOfMe28-Nov-08 2:58
NeverHeardOfMe28-Nov-08 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.