Files . js are not loaded after Actionlink loads Partialview

Asked

Viewed 40 times

0

I have a _Menuleft Partialview that contains my menu items, it is loaded in _Layout with the Html.Partial(") Helper. Inside the 'li' menu there is an Actionlink to click on the div "content" the forms I want, follow the example:

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

The form is being loaded 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 already added them at the end of Partialview (forms) and at another time inside the Bundles and added inside the Section script, but still did not load them . js.

  • This partial is only for "organization" of the code, ie it is called only in the view _Layout?

  • @Randrade Yes is for easy maintenance.

  • Then call your scripts in the view _Layout. Only call a script in a partial, when the use of it is really necessary.

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.