views:

33

answers:

1

I have a gridview with dropdownlist in it. When the user changes the item in the dropdownlist I want to save the new item in the database. I want this to happen using javascript and ajax like effect.

I know how to access the dropdownlist inside gridview using javascript and I can get the new selectd item.

How can I save it to database without server side code? I know one way of doing this is using web services. I just want to know if there is/are any other ways to do it.

+1  A: 

I don't think there is a way for client side script to interact with DB. If you are using ASP .Net there are only three ways you can achieve this:

using a .aspx page

using a .ashx (http handler) or

using a .asmx (web service)

The way you can achieve an AJAX call is to use XMLHttpRequest object.

HTH

Raja
thanks I will use web service