Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have user control with modal popup which is used to show popup whenever necessary.

ASP.NET
<div class="modal fade" id="myModal" role="dialog" aria-labelledby="myModalLabel"
    aria-hidden="true">
    <div class="modal-dialog modal-sm">
         <asp:UpdatePanel ID="upModal" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
            <ContentTemplate>
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×</button>
                <h4 class="modal-title">
                    <asp:Label ID="lblModalTitle" runat="server"></asp:Label></h4>
            </div>
            <div class="modal-body">
                <asp:Label ID="lblModalBody" runat="server"></asp:Label>
            </div>
            <div class="modal-footer">
                <button class="btn btn-info" data-dismiss="modal" aria-hidden="true">
                    Close</button>
            </div>
        </div>
        </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</div>


And back end

C#
private string _Title = null;

public string Title
        {
        get
            {
            return _Title;
            }
        set
            {
            _Title = value;
            }
        }

private string _message = null;

public string Message
        {
        get
            {
            return _message;
            }
        set
            {
            _message = value;
            }
        }
protected void Page_Load(object sender, EventArgs e)
        {
        if (_Title != null)
            {
            lblModalTitle.Text = _Title;
            lblModalBody.Text = _message;
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('#myModal').modal({backdrop: 'static',keyboard: false});", true);
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('#myModal').on('shown.bs.modal', function () { $('#lblModalTitle').focus();})", true);
            upModal.Update();
            }
        }





Now I have aspx page. after the user clicks, server click event generates and after the operation ends I want to show popup with this user control.

what should I have to do that ? currently I implemented interface with method and overridden that method and accessed that in aspx page.
Posted
Comments
Sinisa Hajnal 26-May-15 2:06am    
Add into your register script another function that calls modal.show

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900