Pizzor2000 Posted July 12, 2004 Posted July 12, 2004 Is there a way to find out the type of a given control on an ASP form? For instance, I'm going through each of the controls on a form, and I want to know if it's a text box, select list, or whatever. Quote
wessamzeidan Posted July 12, 2004 Posted July 12, 2004 you can use typeof, for example if typeof ctrl is textbox then 'your code end if Quote Proudly a Palestinian Microsoft ASP.NET MVP My Blog: wessamzeidan.net
Pizzor2000 Posted July 12, 2004 Author Posted July 12, 2004 you can use typeof, for example if typeof ctrl is textbox then 'your code end if Right now, my loops through a collection of controls, as such: Dim coll as NameValueCollection coll = HttpContext.Current.Request.Form For i = 0 to coll.Count - 1 'Do something to each control. Next i Does the NameValueCollection allow me to get the control variables? If not, is there a better way to loop through each control on the form? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.