Open Server Side Bootstrap Modal Pop-up using asp.net - ASP TANMOY

Latest

Thursday, 20 April 2017

Open Server Side Bootstrap Modal Pop-up using asp.net


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 :


Modal Popup Code


<div class="modal fade" id="myModal">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title">
                                Registration done Successfully</h4>
                        </div>
                        <div class="modal-body">
                            <asp:Label ID="lblMessage" runat="server" />
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">
                                Close</button>
                            <button type="button" class="btn btn-primary">
                                Save changes</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
            <!-- /.modal -->  



<button type="button" style="display: none;" id="btnShowPopup" class="btn btn-primary btn-lg"
                data-toggle="modal" data-target="#myModal">
                Launch demo modal
            </button>  

Add JavaScript Code on the page Header



<script type="text/javascript">
        function ShowPopup() {
            $("#btnShowPopup").click();
        }
    </script> 

Write Code on Page load events


protected void Page_Load(object sender, EventArgs e)
{
    ClientScript.RegisterStartupScript(this.GetType(), "alert", "ShowPopup();", true);
    this.lblMessage.Text = "Thank for sending a call back request to 99 WebsitesWe will forword your request soon.";
}  



2 comments:

  1. This blog is really helpful regarding all educational knowledge I earned. It covered a great area of subject which can assist a lot of needy people. Everything mentioned here is clear and very useful.
    ตู้ rack

    ReplyDelete
  2. Open Server Side Bootstrap Modal Pop-Up Using Asp.Net - Asp Tanmoy >>>>> Download Now

    >>>>> Download Full

    Open Server Side Bootstrap Modal Pop-Up Using Asp.Net - Asp Tanmoy >>>>> Download LINK

    >>>>> Download Now

    Open Server Side Bootstrap Modal Pop-Up Using Asp.Net - Asp Tanmoy >>>>> Download Full

    >>>>> Download LINK

    ReplyDelete