ASP.NET button click event does not fire in bootstrap modal

I am using Bootstrap on my website. That registration mode appears when the registration button is pressed. It has several fields and a registration button and a close button. Their code

<div id="myModalRegister" runat="server" class="modal hide fade" tabindex="-1"
 role="dialog" aria-labelledby="myModalLabel"
    aria-hidden="true">
    <div class="modal-header">
     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
            ×</button>
        <h3 id="H1">
            Register</h3>
    </div>
    <div class="modal-body">

    <i class="icon-user"></i>Email ID</label>
        <input type="text" class="span3" id="txtRegEmail" runat="server" />
        <br />
    </div>

    <div class="modal-footer">
        <button class="btn btn-danger" data-dismiss="modal" aria-hidden="true">
            Close</button>
        <asp:Button ID="btRegister" runat="server" CssClass="btn btn-primary" 
            Text="Register" onclick="btRegister_Click" />
    </div>
</div>

Registration button

<li class="one"><a href="#myModalRegister" role="button" data-toggle="modal" >
       <i class="icon-user icon-white"></i> Sign Up</a></li>

When I click the btRegister button, the Click event does not fire. Can you help me?

After some research, it turned out that the modal window is displayed outside the tag Form. and therefore the Event does not shoot. How can I solve this problem?

+5
source share
2 answers

I think you have two options:

  • place the button inside the tag (you do not need your modal to be outside the form tag)
  • javascript .
0

, , ​​, , , BOSS!

0

All Articles