1

The following link shows examples of Bootstrap Modal dialogs. Some examples have button (e.g. Send Email). http://getbootstrap.com/javascript/#modals

If the Modal dialog is on an .aspx form, is it possible to call a method (code behind in .aspx.cs) when user clicks on a button of the modal?

I tried changing the button as follows but it didn't produce any result

<button type="button" runat="server" class="btn btn-primary" onclick="Submit_click">Email</button>

That is the code in method Submit_click never fires.

1 Answer 1

2

I personally like using ASP.Net Server control if possible.

<asp:Button runat="server" ID="Button1" CssClass="btn btn-primary"
   OnClick="Submit_click" Text="Email"/>

If you really want to use button tag, you need to use OnServerClick

<button type="button" runat="server" class="btn btn-primary" 
   OnServerClick="Submit_click">Email</button>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.