2

I am in charge of converting an ASP.NET web application into fully AJAX based application. I know Javascript and Jquery very well.

Initially I thought to point every anchor tag's click event to JS function and to call stuff via ajax and to populate the body and so on. I encountered a problem when it came to ASP.NET Form on every page and when there was need to make a post-back. I decided to point every Form tag's onSubmit event to a JS function to post stuff using ajax and to get results and I got to know this is not possible with ASP.NET as every time where is a button click, there will be post back so it's hard to let page know what button was clicked.

I then decided to use ASP.NET built-in AJAX controls to use with Forms which is pretty easy and worked like the way they should.

Now I am stuck with the question of which I should go with?

I like to be JS way because it's more customizable than AJAX.NET. I highly need your suggestions.

2
  • I think it would be much easier to accomplish this with .net mvc framwrok instead of asp.net forms. Commented Jan 1, 2011 at 16:00
  • @Richard: The application is already created that's why converting it ot MVC framework will create more work for us. Commented Jan 1, 2011 at 17:38

2 Answers 2

1

I don't see a problem in using ASP.NET Ajax. The scriptmanager and UpdatePanel controls will make you task easy and fast to convert to and ajax enabled website. I am not sure what kind of customization you are looking for but you can still use js way whereever necessary. One another plus point with ASP.NET Ajax is it is well tested and used by thousands of sites and comes with lots of controls like in ajaxcontrol toolkit.

Sign up to request clarification or add additional context in comments.

Comments

0

If you want to convert a web forms application completely to JavaScript coding, this is going to be really hard to do. It would be a lot easier to use the updatepanel control to make it look asynchronous to the user, as this doesn't break the server-side integration. But if you are using JS to post back to the server, then wipe the UI and replace it with the new one every time, that's going to be a lot harder.

Ideally, the best way is to use web services, call the web services through JS code (either JQuery or using the Sys.Net.WebServiceProxy ASP.NET AJAX object) to stream the data and you build the client in JS.

Let me know if you want more info...

HTH.

2 Comments

I have no problem using UpdateProblem as long as they fulfill my requirements. After form submission there are are Response.Redirect(...) calls, I want them to be handled when it is converted to UpdatePanel. Also if is there a way to override __doPostBack function of ASP.NET so that each time it's called I modify it's default behavior and get page via AJAX to show under <body>.
Hey, getting the page via AJAX to show the body, do you mean replace the UI in the page? Then UpdatePanel is for you, because it handles all of that for you so that you don't have to do it yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.