<script type="text/javascript">
var s = false;
$(document).ready(function() {
$("#btnSaveEducation").click(function() {
s = true;
});
window.onload = function() {
if (s == false) {
var select = document.getElementById("year");
for (var i = 2011; i >= 1900; --i) {
var option = document.createElement('option');
option.text = option.value = i;
select.add(option, 0);
}
}
};
});
</script>
....
...
<body>
<asp:DropDownList ID="year" runat="server" name="year">
</asp:DropDownList>
</body>
....
..
你好。 在Asp.Net卷筒纸, 我得到这个error
当我click btnSaveEducation
:Asp.net Web窗体错误:回发或回调参数无效
[Invalid postback or callback argument. Event validation is enabled using
<pages enableEventValidation="true"/> in configuration or
<%@ Page EnableEventValidation="true" %> in a page.
For security purposes, this feature verifies that arguments to postback
or callback events originate from the server control that originally
rendered them. If the data is valid and expected, use the
ClientScriptManager.RegisterForEventValidation method in order to
register the postback or callback data for validation.]
为什么? 谢谢。
当我点击F5在Visual Studio中,一切都很好。在下拉列表中有几年。当我刷新页面时,一切都很好。 但是,当我点击按钮,我得到这个错误。 – Jeyhun
我已经完成了。已经没有错误。但是你怎么看?是否可以引起其他proplem为其他元素添加“EnableEventValidation =”false“属性? – Jeyhun
@Shekhar Asp.net检查每个控件后回发....它是什么意思..? –