【问题标题】:Update Panel throws javascript error: "Microsoft JScript runtime error: Member not found"更新面板引发 javascript 错误:“Microsoft JScript 运行时错误:找不到成员”
【发布时间】:2011-06-09 23:46:41
【问题描述】:

我正在使用启用了自动回发的下拉菜单。当我更改更新面板上的值时,它会抛出 javascript 错误Microsoft JScript runtime error: Member not found。我正在使用母版页。

错误位置:

“theForm.submit();”发生错误

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['ctl01'];
if (!theForm) {
    theForm = document.ctl01;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>

Asp.Net/HTML:

    <asp:ScriptManager ID="manager" runat="server" ></asp:ScriptManager>
    <asp:UpdatePanel ID="platformOutputTypes" runat="server" UpdateMode="Always" >
        <ContentTemplate >
            <p>
                <label>Platform</label>
                <asp:DropDownList ID="platform" AutoPostBack="true" runat="server" onselectedindexchanged="PlatformSelectedIndexChanged" ></asp:DropDownList>
            </p>

            <asp:CheckBoxList TextAlign="Left" ID="reportOutputTypes" runat="server" />
        </ContentTemplate>
   </asp:UpdatePanel>

我也在页面上使用 jQuery。

【问题讨论】:

    标签: c# asp.net asp.net-ajax updatepanel


    【解决方案1】:

    找到这个对我有用的链接...

    http://www.velocityreviews.com/forums/t110670-__dopostback-fails-on-web-form-submit-net-2-0-a.html

    一种简单的解决方案。基本上,在我的情况下,检查内容页面和母版页的“提交”的“名称”属性,找到一个带有简单 html 按钮的页面,更改名称,瞧……工作了

    HTH

    戴夫

    【讨论】:

    • 这对我有用,但我猜这似乎是 .NET 中一个非常古老的错误,没有人关心。我希望我能给你+50分。
    【解决方案2】:

    当我使用input type="submit" ...&gt; 并将ID 设置为“提交”时,我通常不会给提交按钮提供ID 为“提交”的提交按钮,但肯定是匆忙地这样做了。当我给提交按钮一个“搜索”的 ID 时,问题就消失了。

    【讨论】:

      猜你喜欢
      • 2012-11-18
      • 2013-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-11
      • 1970-01-01
      • 2011-10-29
      相关资源
      最近更新 更多