1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %> 2 3 ?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4 5 ?<html xmlns="http://www.w3.org/1999/xhtml"> 6 <head runat="server"> 7 <title></title> 8 9 <script src="js/jquery-1.4.2.js" type="text/javascript"></script>10 <script type="text/javascript" >11 $(function() {12 13 $.getJSON("Handler.ashx", {}, function(data) {14 15 $.each(data, function(key, value) {16 17 var option = "<option value=" value.ClassId ">" value.ClassName "</option>";18 $("#DropDownList1").append(option);19 });20 });21 22 23 });24 </script>25 </head>26 <body>27 <form id="form1" runat="server">28 <div>29 <input type ="button" id="jj" value="huoqu" />30 <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true" 31 onselectedindexchanged="DropDownList1_SelectedIndexChanged">32 </asp:DropDownList>33 34 </div>35 </form>36 </body>37 </html>
下面是錯誤信息
回發或回調參數無效。在配置中使用 <pages enableEventValidation="true"/> 或在頁面中使用 <%@ Page EnableEventValidation="true" %> 啟用了事件驗證。出于安全目的,此功能驗證回發或回調事件的參數是否來源于最初呈現這些事件的服務器控件。如果數據有效并且是預期的,則使用 ClientScriptManager.RegisterForEventValidation 方法來注冊回發或回調數據以進行驗證。
添加回答
舉報
0/150
提交
取消