Get individual value of input text with same name
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
Hi, Is there any thing compatible to ASP Request.form("city")(0) in ASP.net. Basically I have a form which has two input text with same name "city" and I want to access individual input text value.
Hi there, In the ASP.NET, the NameValueCollection[^] class is used to contain the form data, so if want to access an input text element with the same name as another one, you can use the sample code as below:
string value = Request.Form.GetValues("city")[0];