我正在使用启用了自动回发的下拉列表。当我更改 updatepanel 上的值时,它抛出 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。
最佳答案
找到这个对我有用的链接...
http://www.velocityreviews.com/forums/t110670-__dopostback-fails-on-web-form-submit-net-2-0-a.html
一种简单的解决方案。基本上,在我的例子中,检查了内容页和母版页的“提交”的“名称”属性,找到了一个带有简单 html 按钮的按钮,更改了名称,瞧……成功了
HTH
戴夫
关于c# - 更新面板抛出 javascript 错误 : "Microsoft JScript runtime error: Member not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6300544/