求高手解决一个很灵异的问题~~急~~~
我用UpdatePanel空间写了一个绑定DropDownList的功能,要求绑定 市 区 商圈,绑定没问题 运行没问题,但是点保存按钮的时候,DropDownList的SelectedIndexChanged事件会重新运行一遍,最后取到的结果是请选择,高手帮我看看咋回事,下面是代码。
HTML代码
<%@ Page Language="C#" MasterPageFile="~/Main.Master" EnableEventValidation="false" ResponseEncoding="GB2312" AutoEventWireup="true" CodeFile="PurchaseEdit.aspx.cs" Inherits="Personal_PurchaseEdit" Title="发布求购信息"%>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" src="../js/calendar.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="t_link"><ul><li>
<asp:Label ID="Label10" runat="server" Text="所在位置"></asp:Label>:
<a href="../Default.aspx" ><asp:Label ID="Label11" runat="server" Text="首 页" ></asp:Label></a> >>
<asp:Label ID="Label9" runat="server" Text="发布求购信息" ></asp:Label></li></ul></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" class="hmain00" align="center">
<tr>
<td class="hmain01_1">
<ul class="ttop02"><li></li></ul>
<ul class="hmain04">
<li style="width:358px;">
<asp:Label ID="Label1" runat="server" Text="地 区:" CssClass="hmtext80"></asp:Label>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager><asp:UpdatePanel id="UpdatePanel1" runat="server"><contenttemplate>
<asp:DropDownList id="ddlCity" runat="server" Width="70px" OnSelectedIndexChanged="ddlCity_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList> <asp:DropDownList id="ddlTown" runat="server" Width="70px" AutoPostBack="True" OnSelectedIndexChanged="ddlTown_SelectedIndexChanged">
</asp:DropDownList>
<asp:DropDownList ID="ddlArea" runat="server" Width="70px">
</asp:DropDownList>
<span style="color: #ff0000">*</span>
</contenttemplate>
</asp:UpdatePanel>
<li style="width:475px;">
<asp:Label ID="Label4" runat="server" Text="关键字:" CssClass="hmtext80"></asp:Label>
<asp:TextBox ID="KeyWord1" runat="server"></asp:TextBox>
<asp:TextBox ID="KeyWord2"
runat="server"></asp:TextBox>
<asp:TextBox ID="KeyWord3" runat="server"></asp:TextBox><span style="color: #ff0000">*</span></li></ul>
<ul clas