aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Access HTML seletced Drop Down List value from Code Behind in C# in ASP.NET

Sep 29, 2014
Introduction :

In this post I will show you how to get the value of a HTML Drop Down List from the code behind (C# code) in ASP.NET. To do this we need a HTML Drop Down List with values and one ASP Button. And on that Button click we will get the selected value from the Code Behind.

Description :

In the previous examples Suresh Dasari had explained AJAX Country State select from Drop Down List, Show toolip in mouse hover  of Drop Down List, SQL Databind in ASP Drop Down List, Validate Drop Down List using JQuery. Now here I will explain get the selected HTML Drop Down List value from Code Behind(.CS file).

So, lets start with creating a new project. Named it what ever you want. And then add a new WebForm. In this WebForm for a Drop Down List we usually use the ASP Drop Down List, but today we will use a simple HTML Drop Down List. So take a Drop Down List and fill it up with values.

Now add a new ASP Button and generate the Click event of that Button. Now on the button click event write down the following code for C#.

string ddl = "";
// to get the selected value
ddl = Request.Form["ddlName"].ToString();
Respose.Write("Name : "+ ddl);

Run your project and get the value of a HTML Drop Down List selected item from Code Behind (C#). Enjoy... :)

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Anonymous said...
This comment has been removed by a blog administrator.
abdul muhaimeen said...

i got null exception in(ddl = Request.Form["ddlName"].ToString();)

Give your Valuable Comments

Other Related Posts

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.