M
Mike Salter
I created a page that reads a DB for questions and possible answers
(usuallyYes/No). I create a panel for each group of questions, and add a
panel for each question to the Group panel. To the Question panel I add a
label with the question text, and a radiobuttonlist with the answers. I
have an eventhandler I add to each radiobuttonlist, which is the same for
all.
The Group panels are then added to Placeholder1.Controls. I then add each
panel to an arraylist arlPanels and do a "Session["arlPanels"] = arlPanels;"
when all are created. This is done in CreatePanesl(). In PersistPanels(),
I get the arlPanels from Session, and add them to Placeholder1.Controls.
This all works pretty good so far. When I click an answer to question 1,
the event fires, no problem. However, when I then click an answer to
question 2, the event fires for question 1 again, and then question 2. The
only way I can seem to prevent this is to set the radiobuttonlist Enabled =
false; in the eventhandler..
I am kinda new to dynamically creating controls in ASP.NET, but I have read
that there are glitches. I would appreciate any suggestions.
In Page_Load:
IF (!IsPostBack)
{
CreatePanels();
}
else
{
PersistPanels();
}
(usuallyYes/No). I create a panel for each group of questions, and add a
panel for each question to the Group panel. To the Question panel I add a
label with the question text, and a radiobuttonlist with the answers. I
have an eventhandler I add to each radiobuttonlist, which is the same for
all.
The Group panels are then added to Placeholder1.Controls. I then add each
panel to an arraylist arlPanels and do a "Session["arlPanels"] = arlPanels;"
when all are created. This is done in CreatePanesl(). In PersistPanels(),
I get the arlPanels from Session, and add them to Placeholder1.Controls.
This all works pretty good so far. When I click an answer to question 1,
the event fires, no problem. However, when I then click an answer to
question 2, the event fires for question 1 again, and then question 2. The
only way I can seem to prevent this is to set the radiobuttonlist Enabled =
false; in the eventhandler..
I am kinda new to dynamically creating controls in ASP.NET, but I have read
that there are glitches. I would appreciate any suggestions.
In Page_Load:
IF (!IsPostBack)
{
CreatePanels();
}
else
{
PersistPanels();
}