开发者

How to programming in asp.net with js in client side, with ajax technology?

开发者 https://www.devze.com 2023-01-24 12:48 出处:网络
I\'m want to build web site in asp.net(because I know this language) in server side, and js (probably jquery) in client side, with Ajax technology.

I'm want to build web site in asp.net(because I know this language) in server side, and js (probably jquery) in client side, with Ajax technology.

  1. I heard that ASP.NET AJAX is too slow, if it's true (is it?) - what are the other options (to combine开发者_高级运维 ASP.NET and Ajax) for me?
  2. Which tool combine all that technologies?

thank u,

and sorry about my poor English.


I agree that the update panels and ajax in .net are not the nicest things to use. As an alternative you could use jQuery or just javascript.

Similar to my answer to this post here is a little synopsis of how to do an AJAX call in .net:

  1. write a server side script (ashx probably) that returns the AJAX response.
  2. use JavaScript (or a library like jQuery) to do the AJAX call to the ashx page. This call will need to pass the query variables to the server via POST or GET. In jQuery there are lots of built in functions for this, such as $.get(), $.post(), $.load() etc...
  3. attach this AJAX call to whatever events you want it to on the front end. Usually a click, but could be a change or a focus
  4. when the AJAX call is completed you will need a JavaScript function that sorts out the returned data. This data could be simple HTML that is added to the page or a more complex JSON object that needs to be formatted. The choice is yours. But this formatting and response needs to be written in JavaScript. in jQuery this function is usually a callback function to one of the AJAX functions. So it automatically gets called when the response has been returned. ie. $.post()


I'm not too sure about the speed and ASP, I can however recommend that you use jQuery for Ajax related development.

MS Studio also seems to have solid support for this, otherwise you could always just install the relevant plugins in Netbeans.

http://jquery.com/

0

精彩评论

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

关注公众号