Question

I'm making lost password recovery on my login page and I'm doing it with ModalPopUpExtender, a Panel and two of those inside of an UpdatePanel. But somehow when clicking the "btnOkPassRequest" full postback happens. People had similiar problems with other controls, some that UpdatePanel obviously didn't encapsulate. But never with a Button. What am I missing?

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>  
    <asp:HyperLink ID="HyperLink2" runat="server">HyperLink</asp:HyperLink>
    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"TargetControlID="HyperLink2" BackgroundCssClass="ModalPopupBG" PopupControlID="pnlPopupPass" CancelControlID="btnCancelPassRequest" OkControlID="Button1"></cc1:ModalPopupExtender>
    <asp:Panel ID="pnlPopupPass" runat="server" CssClass="ModalPopup">   
      <div class="ModalHeader">Password recovery</div>
      <div class="ModalBody">
        <p>Please, enter username.....</p>
        <table>
        <tr>
                <td>Username</td>
                <td><asp:TextBox ID="tbModalUserName" runat="server" class="textbox"></asp:TextBox></td>            
            </tr>
          </table>
        <table>
            <tr>
          <td></td>
            <td><asp:Button ID="btnOKPassRequest" runat="server" Text="Request new password" CssClass="button-wide" onclick="btnOKPassRequest_Click" PostBackUrl="~/Login.aspx" /></td>
            <td><asp:Button ID="btnCancelPassRequest" runat="server" Text="Cancel" CssClass="button-wide"/></td>
            </tr>
        </table>        
      </div>
    <asp:Button ID="Button1" runat="server" Text="Button" />
    </asp:Panel>
</ContentTemplate>
<Triggers>
    <asp:AsyncPostBackTrigger ControlID="btnOKPassRequest" EventName="btnOKPassRequest_Click" />
</Triggers>

Was it helpful?

Solution 3

Actually the problem dissapeared when I switched to ajaxcontroltoolkit v1, instead of using 3.5, which is really confusing

OTHER TIPS

I think EventName should just be "Click" not "btnOKPassRequest_Click" in the trigger

Are you sure this should be there?

 PostBackUrl="~/Login.aspx"

As without this it works fine for me.

I also removed the trigger, but if you need the trigger then the EventName should be Click.

<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:HyperLink ID="HyperLink2" runat="server">HyperLink</asp:HyperLink>
            <asp:Panel ID="pnlPopupPass" runat="server" CssClass="ModalPopup">
                <div class="ModalHeader">
                    Password recovery</div>
                <div class="ModalBody">
                    <p>
                        Please, enter username.....</p>
                    <table>
                        <tr>
                            <td>
                                Username
                            </td>
                            <td>
                                <asp:TextBox ID="tbModalUserName" runat="server" class="textbox"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td>
                            </td>
                            <td>
                                <asp:Button ID="btnOKPassRequest" runat="server" Text="Request new password" CssClass="button-wide"
                                    OnClick="btnOKPassRequest_Click" />
                            </td>
                            <td>
                                <asp:Button ID="btnCancelPassRequest" runat="server" Text="Cancel" CssClass="button-wide" />
                            </td>
                        </tr>
                    </table>
                </div>
                <asp:Button ID="Button1" runat="server" Text="Button" />
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top