I have the following script using ASP.NET MVC2
I have a partial view that uses Ajax.BeginForm to allow partial postback, with the OnSuccess AjaxOptions property pointing to the js function onPartialReloadSuccess. UpdateTargetId is hosted on the parent view of the Application, as specified in the BeginForm script.
This partial view itself displays a number of other partial views whose names are dynamically generated based on the model
<% using (Ajax.BeginForm("Application", new AjaxOptions { UpdateTargetId = "mainframe", OnSuccess = "onPartialReloadSuccess" })) { %> <div id="breadcrumbs"> <% Html.RenderPartial(Model.Breadcrumbs, Model);%> </div> <div id="action"> <% Html.RenderPartial(Model.CurrentView, Model);%> </div> <% } %>
My problem is this: after partial postback, the function of the onPartialReloadSuccess jS function is successfully called without problems, but the javascript contained in the subviews is not updated.
At first they were configured to run after jQuery $ (document) .ready () ... which obviously will not work on partial postback
My question is, is there a way to ensure that javascript is run on these reprocessed partial views? I see many solutions for asp.net forms (using scriptmanager and PageRequestManager), but nothing special for ASP.NET MVC?
in advance for any help
source share