I am searching for control names using Request.Form.
Of course I know you can can iterate around all values using AllKeys, and you can do Form["controlName"] as well.
However some of my control names are dynamic and it would be useful to be able to do stuff like:
1)Getting a subset of controls in the collection whos name start with a certain prefix
2) Search for control names that match a pattern, as you would do with a regular expression.
But there is no way I can see to do stuff like this.
N.B I know how to use FindControl for ASP.NET controls but these are standard HTML.
Best Solution
If you are using C#3 you can use LINQ and extension methods to achieve this in a very nice way. First you need to create an extension method devised by Bryan Watts in this thread:
Now, say you had a form like this:
You could do this in your codebehind:
Which would output: