1
I have an Asp.Net MVC project structured as follows:
On the page Home
there are several links
to others Actions
and Controllers
, and they return a PartialView
that assembles all the content into one modal
.
So far so good, the problem is that when closing a modal of this type, your scripts remain "alive" somehow. Therefore, when opening a new modal that has the same elements of the previously opened modal, the scripts of the closed modal are fired in the new modal.
Is there any way to "kill" these scripts definitely?
Maybe by id
of tag
<script id="scriptZumbi">
.
I think maybe that’s not the way. It’s kind of a gambit. If you can handle the script and modals I suggest seven a class for each modal and direct the script to each class separately according to what you want. Or put the scripts inside each partialview. Maybe if you post some code I can help better.
– Joao Paulo
Is this modal generated within a div or something? Remove it from your code, it also makes the page lighter.
– DontVoteMeDown