Read Request.Form Variables in ASP.NET?

B

Brian Ciarcia

I have a form that uses panels to show and hide a group of questions.
These questions are plain html radio buttons... I need to be able to
submit the form and get the values.. Everything I try doesn't work..
once I move the radio buttons outside the panels, it works fine. Anyone
have any suggestions??
 
C

Craig Deelsnyder

I have a form that uses panels to show and hide a group of questions.
These questions are plain html radio buttons... I need to be able to
submit the form and get the values.. Everything I try doesn't work..
once I move the radio buttons outside the panels, it works fine. Anyone
have any suggestions??

It's because .NET 'renames' the ids of controls in the resulting HTML. If
a control is inside of a parent-container control, .NET concatenates the
two ids, etc. So the id you use in the aspx is not necessarily the same
as what's in the HTML (and therefore the POSTed data).

I believe the property you want is Control.ClientID...the other one that's
similar is Control.UniqueID....
 
B

Brian Ciarcia

I tried looping through the request.form.. I only get the button, which
is outside the panels... This is the code I am using to loop..

---------------------------------------------------------

Dim counter As Integer
Dim arr() As String
Dim coll As NameValueCollection

coll = Request.Form

arr = coll.AllKeys

For counter = 0 To arr.GetUpperBound(0)
Response.Write("Form: " & arr(counter) & "<br>")
Next counter
 
B

Brian Ciarcia

I need to use the two radio buttons for each question. (i.e. yes and no
radio buttons)... These questions will eventually be grabbed from a
database, so that is another reason, i couldn't server controls..
Unless I am totally confused..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top