Can't get simplest ASP.NET MVC3 form to post asynchronously using AJAX?

Up vote 2 down vote favorite share g+ share fb share tw.

I can't see why the following form performs a full postback instead of asynchronously using AJAX. Request.IsAjaxRequest() is always false. I think I've followed all the examples correctly.

What am I doing wrong? Here's the view: @(Layout = null) Index @using(Ajax. BeginForm(new AjaxOptions { UpdateTargetId = "update" })) { } And here's the controller: using System.Web.

Mvc; namespace TheHoges.Web. Controllers { public class TestController : Controller { public ActionResult Index() { if (Request.IsAjaxRequest()) { // never gets here return Content("it worked"); } return View(); } } } asp.net mvc asp.net-mvc-3 razor link|improve this question edited May 24 '11 at 4:54 asked May 24 '11 at 4:47Mikey Cee2,4861929 92% accept rate.

For reference: AJAX and MVC 3 Do you see this in you web. Config? If, yes, including the library above should solve your problem.

Just to be thorough I created a test page. Works peachy... @{ ViewBag. Title = "Home Page"; } @(Layout = null) Index @using(Ajax.

BeginForm(new AjaxOptions { UpdateTargetId = "update" })) { }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions