because my modal appears fast and "disappears"?

0

Hi, I have a project in ASP .NET with C # I have a form to change my password, and for that I have a modify button in which when I click on it, it should show me a modal where a message appears that the password has been modified and a button where you must click on accept and the session must be closed. This is my code:

protected void btnModificar_Click(object sender, EventArgs e)
        {

            Modificar();//funcion para modificar

//string para mostrar mi modal
            string modalScript = @"<script type=""text/javascript"">
             function openModal() {
                  $('#mymodal').modal('show');
                      }
            </script>";
            ScriptManager.RegisterStartupScript(this, GetType(), "bsChgPwdModal", modalScript, false);//
        }

If you show me the modal but then later it "disappears" and I want it to stay there to click on the button and close the session. Thank you!! Greetings

    
asked by sunflower 05.03.2018 в 19:52
source

1 answer

0

If you use bootstrap, do it directly in Html and then activate it with the click and capture data when close.

I'll give you an example code.

Open Modal

         

  <!-- Modal content-->
  <div class="modal-content">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal">&times;</button>
    <h4 class="modal-title">Modal Header</h4>
  </div>
  <div class="modal-body">
    <p>Some text in the modal.</p>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn btn-default" data-
   dismiss="modal">Close</button>
  </div>
  </div>

</div>
</div>

Example link: link

    
answered by 05.03.2018 / 21:55
source