.js files are not loaded after ActionLink loads PartialView

0

I have a PartialView called _MenuLeft that contains my menu items, it is loaded in the _Layout with the Helper Html.Partial (""). Within the 'menu' there is an ActionLink to load into the 'content' div the forms I want, follow the example:

 @Ajax.ActionLink("Empreendimento", "FormRegisterEmprendimento", "Empreendimento", new AjaxOptions()
                        {
                            InsertionMode = InsertionMode.Replace,
                            UpdateTargetId = "conteudo"
                        })

The form is loading normally, but within PartialView (forms) I need to load two .js that validate the fields:

<script src='~/Content/assets/libs/bootstrap-validator/js/bootstrapValidator.min.js'  type='text/javascript'><\/script>;
<script src='~/Content/assets/js/pages/form-validation.js' type='text/javascript'><\/script>;

As tests I've added them to the end of the PartialView (forms) and another time inside the Bundles and added within the section script, but still did not load .js.

    
asked by anonymous 04.05.2016 / 22:18

1 answer

0

You should not load even though your page has already been rendered. Consider loading these js in the _Layout or try to append the js through a jQuery function. See this link: Add CSS and JS in AJAX-loaded PartialView

    
13.05.2016 / 13:55