我在对dropdownlist进行数据绑定时将ispostback设为true 页面会产生javascript错误:
form对象找不到对应的属性或方法 form.submit();出错
导致dropdownlist的事件无响应,
不知道这事什么原因,自动生成的代码也会出错,我真不知道是哪里出来错了,我自己没写代码也出了错,全都是托过开的
form对象找不到对应的属性或方法 form.submit();出错
导致dropdownlist的事件无响应,
不知道这事什么原因,自动生成的代码也会出错,我真不知道是哪里出来错了,我自己没写代码也出了错,全都是托过开的
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<asp:DropDownList id="ddl" runat="server" Width="100%" AutoPostBack="True" OnSelectedIndexChanged="ddl_SelectedIndexChanged"></asp:DropDownList>
protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
{}
</asp:DropDownList></td>
设置AutoPostBack="True"它运行页面会报错