I am trying to implement AJax on Umbraco 5(jupiter), i have tried to create Surface controllers, which works great with normal post back but it do not provide the facility to use Mvc Ajax Controls i-e Ajax.BeginForm Etc…, I have now added a new MVC Area in the Application, i am able to send Post Back through Ajax form easily to the Controller’s Action but i WHAT should i return from this Action, As CurrentUmbracoPage is not accessible(because it is not a Surface Controller), my code is fairly simple,
@using (Ajax.BeginForm("HandleFollowsUs", "propertyDetails", new AjaxOptions { InsertionMode = InsertionMode.Replace, HttpMethod = "POST", LoadingElementId = "ajax-loader", UpdateTargetId = "fuError" }))
{
<input type="image" style="border-width: 0px;" src="/images/btnSubmitN.jpg" id="btn_submitEmail" /></span>
}
AND my ACTION is
[HttpPost]
public ActionResult HandleFollowsUs(FormCollection collection) {
//Do Something
Return View();//////This is where i am confused.
}
If i return View, it is not in the New area, partial View will only return a bit portion of the Page, :/
Any Help would be appreciated,
Thanks,
Sher
Use Jquery Ajax instead and return a string, it wont effect the normal routing of Umbraco 5. Sample Code is as below
}
And my Action is