views:

29

answers:

1

Request.Form[key] has a hashtable-like interface, but I doubt that's how it works. Is there a hashing mechanism for the current Page control set?

How would one pass along a hashed set of all controls between postbacks?

+1  A: 

TextBox ControlId = (TextBox) FindControl("ControlId") works and this library on CodePlex has an extension to enable searching the control tree recursively, which is a common issue (where FindControl returns null or the control otherwise seems to be out of scope).

Also, you should be able to get the value of any control by checking the ControlId.Value property (or what ever the relevant property is, it is different for Label, TextBox, DropDownList, etc)

MatthewMartin
This will work but I guess I was looking for a hashtable solution.
scott
That sounds suspiciously like re-inventing ASP.NET WebForms. If you really don't want to do things the ASP.NET WebForms way (with viewstate, controls trees, postbacks, etc), then you should look into MVC, which dispenses with a lot of the WebForms abstractions. When I'm doing webforms work, I tend to be happier when I stop fighting the system and use it as intended.
MatthewMartin