How to open the same Modal Bootstrap window (cascaded) several times with different contents?

Asked

Viewed 62 times

1

I am a layman in web programming and I am working with bootstrap modals windows in an Asp.net MVC project. I come from the Desktop world and I confess that I am having difficulties with the implementation of Modals screens. In the Desktop apps, you can repeatedly call a window, that is, instantiate it, open it and display new content (multiple instances of the same window).

With the bootstrap I create a DIV to be the container of my modal and call it by the id "modalGenerica", for example:

<div class="modal modal-primary" role="dialog" id="modalGenerica">
    ...
</div>

When a modal window "modalGenerica" is open on the page, and if I need to open again other instances of the same modal "modalGenerica" (cascading)?

I tried to implement it, but it’s a mistake. Only that I don’t see any productivity, having to create several modal Ivsgenerica1, modalGenerica2, modalGenerica3, etc., even, because I don’t know how many times an instance of the same modal will be cascaded open... Is there a solution to this? If there is, someone would have a basic example to help me?

Thank you very much and a hug to all!

  • Why don’t you call for the class and not the id? I’m lego in the subject, but thinking that ids are unique and a class would sometimes help you...

No answers

Browser other questions tagged

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