I'm stuck in Classic 开发者_Python百科ASP for the time being, and wondered if some of my grid editing pages (editing a row or record) might benefit from some async JQuery Ajax-type calls to update parts of the page and the database instead of doing a million self postbacks with postback codes indicating what needs to change.
I assume I have to call an ASP page with the jQuery, and that page would do the data access/record updating for me.
Is this overkill, or would this be a sensible way to code the pages without the old-fashioned postback hell?
Ajax is the way to go here, otherwise, your page will end up being annoying for users (waiting for pages to load for minor changes).
Also, just because the page with the form is written in ASP Classic doesn't mean you have to handle the AJAX requests with ASP Classic. For example, (depending on the complexity) it might be easier to setup an MVC site to handle these requests and send JSON or XML than it would be to implement all that in classic.
Yes working with jQuery Ajax for updating part of the website instead of postback and load the whole page is a way to go. It might be a little bit more work but it's definitely the approach you should be using.
Alternatively, you can browse for many ASP grid controllers out there that will also do Ajax update/delete for you.
精彩评论