Sometimes its very mush important to get the value of the HTML Drop Down List, Select value from the code behind (C#). So how to get the value of a HTML control value in the code behind. A very easy thing to do.
Create a new project and add a WebForm and add a new select tag with some value. Like this
Now in the C# page write the code to get the value.
To get the selected value the actual code is
In this way you can get the data of a HTML field from code behind (C#). With in that click event write down the following code
Create a new project and add a WebForm and add a new select tag with some value. Like this
Now in the C# page write the code to get the value.
string ddl = ""; // to get the selected value ddl = Requets.Form["ddl"].ToString();
To get the selected value the actual code is
Requets.Form["ddl"]
In this way you can get the data of a HTML field from code behind (C#). With in that click event write down the following code
Not working.
ReplyDeleteBut I want selected value and text both
ReplyDelete