Hi everyone I have use a <%= Ajax.ActionLink like this…
<%= Ajax.ActionLink("Change Image", "ChangeImgWithData", "Package",
new AjaxOptions() {UpdateTargetId="img", InsertionMode= InsertionMode.Replace , HttpMethod="GET"})%>
<div id="img"> </div>
in my controller I have this..
public ActionResult ChangeImgWithData()
{
if (Request.IsAjaxRequest())
{
return PartialView("~/Views/Package/_Change.ascx");
}
else
{
return View();
}
my Request.IsAjaxRequest() is null, I dont no why?? I want to show partialView _change inside the img div
any idea? Thanks!!
I don’t know why IsAjaxRequest() is null but you could create an action that returns the partial. Something like this
You might also have to reference the jquery unobtrusive-ajax library in the view.