create java script functions after rendering all partial views

0

I have a MVC aspnet code with a main view that can call 3 partials view depending on where the user clicks.

One of these partial view was part of the main view and has a jquery pluguin sortable ui, while it was in the main view the pluguin worked perfectly but when I separated for the partial view it stopped working, I believe it's because of the javascript / jquery handling sortable ui that are in a document.ready.

I would like to know if it is possible to create a jquery function "documentAndAllPartialViewsLoad" since I even tried to change the jquery functions of place.

    
asked by anonymous 22.02.2017 / 00:46

3 answers

0

Try to put the reference of your plugin in your MasterPage ... This may be happening because the reference is being made in your Partial.

    
22.02.2017 / 01:06
0

Where do you include js ?!

Make sure you are not doing the rendering after rendering the partials, and within the partials you try to use for example a jquery that is not yet loaded.

If this is the case, load the js and only then invoke the partials

    
23.02.2017 / 17:55
0

Hello everyone, thanks for the help.

In case the problem was that the functions in the partial view were inside a tage

@section sript {} tag that does not work in partial views

So it was only a change of the tag that everything started working.

    
24.02.2017 / 18:16