Escape Key Issues with Update Panel

北慕城南 提交于 2019-12-07 05:04:33

问题


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>

回答1:


•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/



来源:https://stackoverflow.com/questions/20897321/escape-key-issues-with-update-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!