locked
ConfirmButtonExtender not work on remote server ! RRS feed

  • Question

  • User-543900776 posted

    Hello,

    In my web project while I'm working on local computer the ConfirmButtonExtender control works fine, but on remote server ( production server ) the control not working on all pages ( click event fires without confirm message ) .

    ASP code :

     <asp:LinkButton runat="server" ID="lnkLogout" CausesValidation="false" OnClick="lnkLogout_Click">
      Log Out
    </asp:LinkButton>

     <asp:ConfirmButtonExtender ID="LogExtender" runat="server"
                                            ConfirmText="Are you sure to Logout ?" TargetControlID="lnkLogout" Enabled="true">
                                        </asp:ConfirmButtonExtender>

    C# code :

    Session.RemoveAll();
    Session.Abandon();
    Response.Redirect(System.Web.VirtualPathUtility.ToAbsolute("~/" + Modules.PO.URLCenter.LoginEn));

    * note : if I use following approach it works fine :

    lnkLogout.OnClientClick = "return confirm('are you sure to logout ?');";

    Thanks in advance,

    Monday, July 6, 2015 1:17 AM

Answers

  • User61956409 posted

    Hi Dev.Bassem,

    Firstly, I create a sample to test your code, the code seems ok.

    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
    <div>
        <asp:LinkButton runat="server" ID="lnkLogout" CausesValidation="false" OnClick="lnkLogout_Click">
    Log Out
        </asp:LinkButton>
    
        <asp:ConfirmButtonExtender ID="LogExtender" runat="server"
            ConfirmText="Are you sure to Logout ?" TargetControlID="lnkLogout" Enabled="true">
        </asp:ConfirmButtonExtender>
    </div> 
    

    Secondly, you could use the Developer Tools (F12) to check if any errors are present in the Console section.

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 6, 2015 10:13 PM