Hemraj Rav

Hemraj Rav

  • NA
  • 37
  • 3.3k

@Ajax.actionlink in MVC 4

Jun 6 2017 12:20 AM
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)