ASP.NET ModalPopup does not execute code

When I click the button in the popup to insert data into the database, it does nothing WHYYYYY?

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BehaviorID="popup" TargetControlID="cmdTrigger" 
            PopupControlID="pnlPopup" BackgroundCssClass="modalBackground"
            OkControlID="btnOk" >
    </cc1:ModalPopupExtender>  
    <asp:Panel ID="pnlPopup" runat="server" CssClass="modalpopup" Style="display: none">
        <div class="container">
            <div class="header">
                <asp:Label ID="Label1" runat="server" CssClass="msg" Text="Add a new Entry" />
                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClientClick="$find('popup').hide(); return false;" />
            </div>
            <div class="body">
                <asp:Label ID="Label2" runat="server" CssClass="msg" Text="Name" />
                <asp:TextBox ID="txtName" runat="server" Width="346px"></asp:TextBox>
                </div>
            <div class="footer">
                <asp:Button ID="btnOk" runat="server" Text="Save" Width="48px"   />
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="50px" OnClientClick="$find('popup').hide(); return false;" />
            </div>
        </div>
    </asp:Panel>

      

BtnOK code

plain textbox1.text = txtName

I even try to set a breakpoint, the button click event is not fired. Any ideas?

Edit ~ Solution

Follow http://forums.asp.net/t/1070213.aspx

+1


source to share


2 answers


Remove the OkControlId property as I think it prevents postbacks from occurring.



+2


source


Delete CausesValidation="false"

to make it true. It will work.



0


source







All Articles