I have an error when loading a partial view in the following way, the problem is that when loading a second time the modal window tries to load the javascript file, therefore it gives an error in the variables that have already been declared more than once.
Partial View Controller
[AllowAnonymous]
public ActionResult _ClaimDetail()
{
return PartialView();
}
Javascript call to load modal
$(buttonCharge).ModalPersonalize('show', urlController, 'rebuild title');
PartialView Modal cshtml
<div class="modalbody">
</div>
<div class="modalbuttons">
</div>
</div>
<script src="@Url.Content("~/JavacriptLogicModal.js")" type="text/javascript"></script>
The error occurs when the modal is opened for the second time, How could I solve it, some way to render once the javascript file?
I already tried adding validations but nothing works