Bind Asp.Net DropDownList using jQuery?

In today's post i am going to cover "How to bind dropdown list in asp.net using jquery.?In the previous tutorials i have explained sealed class ,Abstract class ,Ajax call,Ref and Out Keyword,Autoeventwireup Event in Asp.Net   etc.

Before moving to the topic I am assuming that you are aware of Jquery Ajax call ,if now please go through this post before moving further - How to call page method using jquery ajax call

Let start with an example of binding countries name to dropdown list.To do that first create a Country table in MS-SQL.

Create table in Sql

 Once table creation done.Enter some countries name.

Create table in Sql

Now time to create page in visual studio.Here is the HTML markup.


Once above steps has done.Create a webmethod to retrieve the data from table that we create above.
Now add below script to web page that will call above webmethod to fetch the countries from database.


Output:
Bind dropdown output

Conclusion

I hope that this article would have helped you in understanding the way to bind DropDownList using jQuery in ASP.NET.Your feedback and constructive contributions are welcome.

Thanks

Bind Asp.Net DropDownList using jQuery? Bind Asp.Net DropDownList using jQuery? Reviewed by CodiBucket on 09:02 Rating: 5

No comments:

Facebook

Powered by Blogger.