For each item in request.form
As I'm not actually using request.form in ASP.NET, how can I loop through all the elements in a form?
ThanksI think the following should help:
Dim c As New Control()
For Each c In me.controls
'place your code here
Next
Sim
Thanks for that,
Errrr another newbie question - how do I actually access the value of each form element?
Again, in ASP, Iwas able to request each value as I looped through the elements - how do I access them in ASP.NET?
Also - what exactly is the me bit of me.controls?
For accessing the values see this article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskreferencingcontrolsinwebformspages.asp
This should solve your problem.
me.controls is referring to all the controls in the current form object, in your current web form.
I hope that wasn't too confusing...
~s
Actually, you can still use Request.Form to loop through the data that was submitted by the browser. However, the recommended way is to access the objects associated with your form elements. Check out "Introducing Web Forms" from the "Tutorials" tab at the top of this page.
AutoFed
0 comments:
Post a Comment