Link to home
Start Free TrialLog in
Avatar of Ed
EdFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Bootstrap Modal from Code

Could anyone tell me how to fire a modal popup (bootstrap) from vb code.

       <asp:Button ID="btnCancelApt" runat="server" Visible ="true" Text="Cancel" CssClass="btn btn-primary btn-xs" CommandName="Cancel" data-toggle="modal" data-target="#CancelApt" />

Open in new window


Using Ajax modal  it would be   modalname.show()

I have tried

    Protected Sub btnCancelApt(sender As Object, e As EventArgs)
            ScriptManager.RegisterStartupScript(Me, [GetType](), "Show Modal Popup", "#CancelApt();", True)
        End Sub

Open in new window


but it does not work..
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ed

ASKER

Yes, it works perfectly... you are a genius.... thanks..
Avatar of Ed

ASKER

Perfect Solution
Glad it helped :-)