<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檢查每個控件後回發....它是什麼意思..? –