开发者

using jquery with database

can some one give me some perfect example or point me to the blog or forum where I can find jquery link with database. That is jquery doing some manuplation on the values from the database ? especially checkboxes and radi开发者_JAVA百科o button

I only want the example linking client side and server side interaction using jquery


You need to read up on the concepts behind AJAX. Getting a value from a database has nothing to do with JS.

One approach is to use ASP.NET WebMethods and a ScriptManager to link your codebehind (Where you have DB access) to your JS on the client side.

http://www.xdevsoftware.com/blog/post/Call-WebMethod-from-Javascript-in-ASPNET.aspx

This way your javascript calls a method in your codebehind that looks up the value and returns it to your javascript which will then use jQuery to show/hide a div for you.

Javascript (ask for show/hide status) -> Webmethod (ASP.NET DB Lookup) -> Javascript (show hide with jquery based on result)


Javascript has nothing to do with DBs. It, on the other hand, can interact with server side scripts (trough AJAX) that can interact with DBs.

Check out the jQuery.ajax() method here: http://api.jquery.com/jQuery.ajax/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜