5
Answers

@Ajax.actionlink in MVC 4

Hemraj Rav

Hemraj Rav

7y
306
1
Hi,
 
please see below code , when clickon this link why it replaces entire page ratherthan target id "idDev".
 
I tried latest script also, but still same issue.It replace entire page with layout page content also.
 
can anybody suggests. 
 
 
@{
ViewBag.Title = "TestAjax";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>TestAjax</h2>
@Ajax.ActionLink("Click Ajax", "TestAjaxLink", new AjaxOptions {
UpdateTargetId = "idDev",
InsertionMode = InsertionMode.Replace
})
<div id="idDev" >
@ViewBag.TitleName
</div>
 
 
please see below screen shot also.
 
 
 
 
Thanks in advance.
 
Regards
 
Hemraj 
 
Answers (5)