Click here to Skip to main content
15,888,968 members
Home / Discussions / Web Development
   

Web Development

 
QuestionCode Reviews - How do you do it? Pin
ikorenbl8-Apr-08 7:35
ikorenbl8-Apr-08 7:35 
AnswerRe: Code Reviews - How do you do it? Pin
User 98858-Apr-08 7:45
User 98858-Apr-08 7:45 
QuestionHow to integrate ASP.NET compiled aspx page with my own C# server ??? Pin
Andrew_3O8-Apr-08 6:15
Andrew_3O8-Apr-08 6:15 
AnswerRe: How to integrate ASP.NET compiled aspx page with my own C# server ??? Pin
Andrew_3O8-Apr-08 6:26
Andrew_3O8-Apr-08 6:26 
AnswerRe: How to integrate ASP.NET compiled aspx page with my own C# server ??? Pin
Shog98-Apr-08 17:48
sitebuilderShog98-Apr-08 17:48 
QuestionHow to rebind the select box (html drop down list control) after updating the values into the database? Pin
j1_jon8-Apr-08 3:35
j1_jon8-Apr-08 3:35 
GeneralRe: How to rebind the select box (html drop down list control) after updating the values into the database? Pin
Ashish Sehajpal9-Apr-08 3:32
Ashish Sehajpal9-Apr-08 3:32 
QuestionDynamically added controls don't appear in View's control collection. Pin
WebMaster7-Apr-08 12:55
WebMaster7-Apr-08 12:55 
I've been working with ASP .NET and data for a couple months now. I'm creating a web app that is more or less a "virtual worksheet" with multiple choice questions. I get the question text and four answers from an Access database. Using data from an invisible GridView, I create Labels and RadioButtonLists at runtime and add them inside a View in my MultiView.

For I As Integer = 0 To Me.gvQMultipleChoice.Rows.Count - 1<br />
            Dim lbl As New Label<br />
            lbl.ID = "lblQ" & I<br />
            lbl.Text = I + 1 & ". " & Me.gvQMultipleChoice.Rows(I).Cells(0).Text<br />
            Me.vw1.Controls.AddAt(Me.vw1.Controls.Count - 5, lbl)<br />
            Dim rad As New RadioButtonList<br />
            rad.ID = "rad" & I<br />
            For I2 As Integer = 0 To 3<br />
                rad.Items.Add(SwitchChar(I2) & ". " & Me.gvQMultipleChoice.Rows(I).Cells(I2 + 1).Text)<br />
            Next<br />
            rad.RepeatDirection = RepeatDirection.Horizontal<br />
            Me.vw1.Controls.AddAt(Me.vw1.Controls.Count - 5, rad)<br />
Next


Basically, make a Label, get its question text, add it to the View. Same with the RadioButtonList. This works fine. My problem is later, when I am trying to find out which RadioButton is selected. Me.vw1.Controls doesn't contain any of these Labels or RadioButtonLists.

<br />
Dim myControls As ControlCollection = Me.vw1.Controls<br />
For I As Integer = 0 To myControls.Count - 1<br />
            If myControls(I).ID <> Nothing Then<br />
                If myControls(I).ID.StartsWith("rad") Then<br />
                    Dim rad As RadioButtonList = Me.vw1.Controls(I)<br />
                    ans &= rad.SelectedIndex<br />
                Else<br />
                    'ignore<br />
                End If<br />
            End If<br />
Next


This should work fine, I'm confident it would. But again, the problem is that the dynamically created controls aren't in the list. Does anyone know why it would be like this.

By the way, the Labels and RadioButtonLists show up, and I can select a RadioButton. The second bit of code is executed on a Button.Click event.

Thanks!

Evan Stoner
Breeze Innovations

GeneralAh, there's the trouble - you've got yourself a rift in the space-time continuum... Pin
Shog97-Apr-08 14:07
sitebuilderShog97-Apr-08 14:07 
QuestionAdd them myself? Pin
WebMaster7-Apr-08 14:22
WebMaster7-Apr-08 14:22 
GeneralRe: Add them myself? Pin
Shog97-Apr-08 14:56
sitebuilderShog97-Apr-08 14:56 
GeneralOops. Pin
WebMaster7-Apr-08 15:04
WebMaster7-Apr-08 15:04 
GeneralConditional HTML Pin
Yariv7-Apr-08 10:29
Yariv7-Apr-08 10:29 
GeneralRe: Conditional HTML Pin
Shog97-Apr-08 10:51
sitebuilderShog97-Apr-08 10:51 
GeneralRe: Conditional HTML Pin
Yariv7-Apr-08 18:43
Yariv7-Apr-08 18:43 
GeneralRe: Conditional HTML Pin
Shog98-Apr-08 5:26
sitebuilderShog98-Apr-08 5:26 
GeneralRe: Conditional HTML Pin
led mike7-Apr-08 11:30
led mike7-Apr-08 11:30 
QuestionHow To Make a hyperlink using Javascript.......? [modified] Pin
codingrocks5-Apr-08 19:26
codingrocks5-Apr-08 19:26 
AnswerRe: How To Make a hyperlink using Javascript.......? Pin
Christian Graus6-Apr-08 11:54
protectorChristian Graus6-Apr-08 11:54 
GeneralRe: How To Make a hyperlink using Javascript.......? Pin
led mike7-Apr-08 5:04
led mike7-Apr-08 5:04 
GeneralRe: How To Make a hyperlink using Javascript.......? Pin
Shog97-Apr-08 5:06
sitebuilderShog97-Apr-08 5:06 
GeneralRe: How To Make a hyperlink using Javascript.......? Pin
Christian Graus7-Apr-08 12:29
protectorChristian Graus7-Apr-08 12:29 
AnswerRe: How To Make a hyperlink using Javascript.......? Pin
Sachin Pimpale6-Apr-08 21:36
Sachin Pimpale6-Apr-08 21:36 
GeneralFill area Image Map Help me soon Pin
Member 12583735-Apr-08 17:53
Member 12583735-Apr-08 17:53 
GeneralPosition of table differs in different browsers [modified] Pin
ASPnoob4-Apr-08 21:33
ASPnoob4-Apr-08 21:33 

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.