Click here to Skip to main content
15,890,717 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
QuestionHttpModule server problem [modified] Pin
sepel28-Nov-08 2:30
sepel28-Nov-08 2:30 
AnswerRe: HttpModule server problem Pin
Vinit Sambhare7-Dec-08 23:01
Vinit Sambhare7-Dec-08 23:01 
GeneralRe: HttpModule server problem Pin
sepel8-Dec-08 2:18
sepel8-Dec-08 2:18 
GeneralRe: HttpModule server problem [modified] Pin
Vinit Sambhare8-Dec-08 2:37
Vinit Sambhare8-Dec-08 2:37 
GeneralRe: HttpModule server problem Pin
sepel8-Dec-08 2:46
sepel8-Dec-08 2:46 
GeneralRe: HttpModule server problem Pin
Vinit Sambhare8-Dec-08 17:31
Vinit Sambhare8-Dec-08 17:31 
GeneralRe: HttpModule server problem Pin
sepel9-Dec-08 19:17
sepel9-Dec-08 19:17 
GeneralRe: HttpModule server problem Pin
Vinit Sambhare14-Dec-08 23:05
Vinit Sambhare14-Dec-08 23:05 
QuestionIIS Book for reading Pin
ahawari0928-Nov-08 2:27
ahawari0928-Nov-08 2:27 
AnswerRe: IIS Book for reading Pin
Abhijit Jana28-Nov-08 2:33
professionalAbhijit Jana28-Nov-08 2:33 
QuestionDeploying asp.net website Pin
ahawari0928-Nov-08 2:20
ahawari0928-Nov-08 2:20 
AnswerRe: Deploying asp.net website Pin
Abhijit Jana28-Nov-08 2:28
professionalAbhijit Jana28-Nov-08 2:28 
AnswerRe: Deploying asp.net website Pin
Abhijit Jana28-Nov-08 2:32
professionalAbhijit Jana28-Nov-08 2:32 
Generalworking with data list , gridview and pop up window Pin
aamirzada28-Nov-08 2:14
aamirzada28-Nov-08 2:14 

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.