在Asp.net MVC中使用Ajax

I am a begineer in MVC and i need to know is it easy to use ajax with asp.net mvc ? i mean that if it is like asp applications when using ajax(JS file,web service or ajax toolkit)? I didn't try it b4 but what i need to know how can i use ajax with mvc application and i hope from any one give me an answer and put a link for articles about this topic not to put a link for general article about mvc i need a specific one about ajax with mvc and specially to be clear and with examples as i got confused from thoses articles that talked about this topic without any example.

I have read an article and noticed a code for calling ajax but i didn't understand it's structure so can any one tell me in steps and an example how to use ajax in MVC application? I am too sorry for this question that i restrict the answer but i am begineer in MVC and got confused and need a tutorial for any issue. And i need to know what are the consequences of using MVC in asp.net ? what are progress added to web programming after MVC is released in asp.net ? whate are improvements that had been added ?

Thanks in advance for any reply or answer

You've meshed up two questions into one. I'll try to address them both.

Using AJAX in ASP.NET-MVC is no different from using it in WebForms. You define an action on your controller and call it via jQuery (or any other javascript library).

Consequences of using ASP.NET-MVC? Hmm, this is a tough one. I prefer the MVC approach over WebForms because it's cleaner and easier to maintain later (this is just my viewpoint). I suggest that you read a good book on the subject, 'cos I have a feeling that you're not quite grasped the concept. I would really recommend Pro ASP NET MVC Framework.

I echo the suggestions that you read up on the core concepts behind ajax. Once you do, the rest of my answer might be helpful to come back to :)

Back? Ok!

You will be very pleasantly surprised. You can really just include the jquery libs into your master page and then freely just use jquery in your views as you would in pure HTML.

Somehting I do is add a ContentPlaceHolder just before the close of the head tag int he site master template...

<asp:ContentPlaceHolder ID="JavascriptContent" runat="server" />

That way in my views, if I need some per view jQuery I can simply do somehting like..

<asp:Content ID="Content6" ContentPlaceHolderID="JavascriptContent" runat="server">
<script type="text/javascript">
    $(function() {
          alert("Hi!");
    });
</script>

And it just drops right in. On those pages where you don't need it, simply don't assign the placeholder.

Hope that helps!

Ken

This is how to emulate UpdatePanel in ASP.NET MVC.
This is how you can submit form with Ajax.
This is another sample of using built-in AjaxHelper.