Open Bootstrap Modal from code-behind

后端 未结 7 2091
梦谈多话
梦谈多话 2020-12-13 18:18

Anyone knows how to open a twitter bootstrap modal, from code behind?

I want to open the modal based on some requeriment at the moment of the save. Something like \"

7条回答
  •  情深已故
    2020-12-13 19:09

    Maybe this answer is so late, but it's useful.
    to do it,we have 3 steps:
    1- Create a modal structure in HTML.
    2- Create a button to call a function in java script, to open modal and set display:none in CSS .
    3- Call this button by function in code behind .
    you can see these steps in below snippet :

    HTML modal:

    
                  
    

    Hidden Button:

        
    

    Script Code:

      
    

    code behind:

    protected void Page_Load(object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(this.GetType(), "alert", "ShowPopup();", true);
        this.lblMessage.Text = "Your Registration is done successfully. Our team will contact you shotly";
    }  
    

    this solution is one of any solutions that I used it .

提交回复
热议问题