I am creating an ASP.NET application that allows the user to add form elements to a page within a form. When the page is posted (via the submit button) I need to loop throug
foreach (string key in Request.Form) { var value = Request.Form[key]; }
The Request.Form property returns a NameValueCollection you can iterate over:
foreach (string name in Request.Form.AllKeys) { string value = Request.Form[name]; // Do something with (name, value). }