I'm using the PagedList nuget package in a partial view in my application. My partial contains a number of buttons that open bootstrap modal windows. There's also some sections of the partial where I use a jQuery plugin that truncates multi-line text.
On initial page load, everything works - truncation, bootstrap JS features etc. When I navigate to the second page of results, and then back to the first all of these features stop working.
The links used to navigate pages are Ajax.ActionLink():
@Ajax.ActionLink("Next >", "GetAllProperties", new { page = Model.PageNumber + 1 },
new AjaxOptions { UpdateTargetId = "quick-property-search-results" })
I've used $(document.body).on('click', '.view', function (e) {...};
in all my jQuery functions to bind event handlers after document.ready, but still no joy. After navigating back/forth through 'paged' pages, if I try to open a modal I'll get
Object [object Object] has no method 'modal'
I've created a collabedit which illustrates a simplified version of my layout, view and partial view with hopes that it may offer more insight to the problem.
Would really appreciate a solution to this one.
Found out what the issue was. In the partial where I am using pagination, I had an additional reference to jQuery, so, I think anything that was bound to jQuery initially, wasn't after an Ajax.ActionLink()
made a GET request for any additional 'paged' pages, hence I was getting Object [object Object] has no method 'X'.