开发者

save to sql server database from client side

开发者 https://www.devze.com 2022-12-28 12:09 出处:网络
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 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 i开发者_开发知识库t 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消