Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Escape Key Issues with Update Panel

while hitting ESC key twice when on a page containing an update panel with a any control inside, say textbox or listbox im getting a System.ArgumentException: Invalid postback or callback argument. I have checked in remaining browsers its working fine but in Internet Explorer 8 its creating above said problem.

the possible solution i found, is making EnableEventValidation="false" either at page level or webconfig or disabling escape key. i dont want to go with 2 former solutions as either my site security will compromise and i dont want my escape key to disable.

Any Suggestions/Ideas appreciated.

Code :

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"
        EnablePageMethods="true">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanelHeader" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div id="Search">
                <table style="empty-cells: hide;" width="100%" cellpadding="0" cellspacing="0" class="controlsTable">
                    <tr>
                        <td class="td4Caption">
                            Some Text
                        </td>
                        <td class="tdpadding">
                            <asp:TextBox ID="txtbox" ClientIDMode="Static" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:ImageButton SkinID="Export" AlternateText="Generate Report" ToolTip="Generate Report"
                                ID="ibtnGenerateReport" ValidationGroup="Generate" runat="server" OnClick="ibtnGenerateReport_Click" />
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
like image 469
Rahul Jain Avatar asked Nov 11 '22 15:11

Rahul Jain


1 Answers

•Another thing you can try is: EnablePartialRendering="false" to asp:ScriptManager

Make sure your site is rendering with the proper compatibility by using "edge": < meta http-equiv="X-UA-Compatible" content="edge" />

If nothing above works, please try controlling the exception handler like this:

http://encosia.com/how-to-improve-aspnet-ajax-error-handling/

like image 111
Dalorzo Avatar answered Nov 14 '22 21:11

Dalorzo