I used mvc 4.0 to develop my web application, I have created a pager and data-list it works fine, I implement it by some jquery code and I define $.get jquery method to get a partial view as new page like this :
$.get("http://localhost:13824/bid/index?page=8&script=1", function(data) {
$Element.html(data);
}
on the other side in control I have Action method like following :
public ActionResult Index(string provinceNo="21", int page=1, string script="0"){
if(script=="1") { return PartialView("mypartialwebusercontrol",model); }
else // do something else;
}
in the web user control I have some items it loads all items and my pager works very nice but there is a problem I have link in each item that is for opening a popup window when I click on pager it calls $.get method. all click events and scripts wont be rise again.
my web user control is like this :
<% control language="c#" inherits="system.web.mvc.viewusercontrol<model>" %>
<% foreach(var item in model) { %>
<div id="card1">
<a class="linkbutton"> item.text1 </a>
</div>
<% } %>
all of the click script will be stop after $.get method calling.
Still not sure what you mean by ‘in constructor’, but I can see two possible causes of the problem:
If its neither of these, you’ll need to give a full listing of your Javascript or a link to a page where me or someone else can see exactly what’s going on