<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %> <table height="100%" cellSpacing="0" cellPadding="0" width="800" align="center" border="0">
<tbody>
<tr>
<td vAlign="top" align="center"><br>
 <asp:ScriptManager ID="ScriptManager1" runat="server">
                            </asp:ScriptManager>
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
<table style="position:absolute;left:2px;BORDER-RIGHT: #CCCCCC 1px solid; BORDER-TOP: #CCCCCC 1px solid; BORDER-LEFT: #CCCCCC 1px solid; BORDER-BOTTOM: #CCCCCC 1px solid"
cellSpacing="0" cellPadding="0" width="750" align="center" bgColor="#b7cde4">
<tbody>
<tr bgColor="#F3F4F6">
<td colSpan="2" height="4"></td>

</tr>
<tr bgColor="#F3F4F6">
<td width="100%" height="24" align=left><span class="GrayFont">&nbsp;&nbsp<asp:label id="lblMenuName" runat="server">人事資料維護</asp:label>
<asp:label id="lblMode" runat="server" ForeColor="#215dc6"></asp:label>
</span>
</td>
</tr>
<tr bgColor="#F3F4F6">
<td colSpan="2" height="4" bgcolor="#E87269"></td>
</tr>
<tr bgColor="#ffffff">
<td align="center" colSpan="2" style="height: 120px">
<table id="table1" height="120" cellSpacing="0" cellPadding="0" width="100%" border="0"
runat="server">
<td>

                         
<tr>
<td colSpan="4" height="10"></td>
</tr>

<tr>
<td height="30" style="width: 1px"></td>
<td bgColor="#F3F4F6" align="left">
                                                        &nbsp;
                                                        工廠名</td>
<td>:</td>
<td align=left>
                                                        <asp:DropDownList ID="DropDownList1" runat="server" Width="216px" AutoPostBack="True">
                                                        </asp:DropDownList></td>


</tr>
<tr>
<td height="30"></td>
<td bgColor="#F3F4F6" align="left">
                                                        &nbsp;
                                                        部門名</td>
<td>:</td>
<td align=left>
                                                        <asp:DropDownList ID="DropDownList2" runat="server" Width="216px" AutoPostBack="True">
                                                        </asp:DropDownList></td>


</tr>

<tr>
<td colSpan="2" style="height: 40px">&nbsp;</td>
<td style="height: 40px">&nbsp;</td>
<td vAlign=middle align=left colSpan="4" style="height: 40px">
<P>
<asp:button id="cmdOk" runat="server" CssClass="Button" Text=" 確 定 "></asp:button>&nbsp;&nbsp;
<asp:button id="cmdDelete" runat="server" CssClass="Button" Text=" 刪 除 "></asp:button>&nbsp;&nbsp;
<asp:button id="cmdReturn" runat="server" CssClass="Button" Text=" 返 回"></asp:button>
                                                            <asp:Label ID="Label4" runat="server" BorderColor="Red" ForeColor="Red"></asp:Label></P>
</td>
</tr>
<tr>
<td colSpan="4" height="47">
                                                        <cc1:msgbox id="msg" runat="server"></cc1:msgbox>
                                                    </td>
</tr>


</td>
</table>
  
</td>
</tr>
</tbody>
</table>
                            </ContentTemplate>
                            </asp:UpdatePanel>
</td>
</tr>
</tbody>
</table>

解决方案 »

  1.   

    因为是服务器端控件都有这种问题,建议用客户端控件加Ajax来做
      

  2.   

    利用AJAX Control ToolKit控件集里面的CascadingDropDown控件可以实现,CascadingDropDown控件 类型:具有AJAX功能的Extender控件功能:提供一组联动式的DropDownList,可在不Postback的状况下,通过WEB services动态从Server端(数据库中)获取DropDownList内的Item。使用时机:在页面上呈现出分类选项,例如工厂、部门等多层次数据,item数众多,想通过多个DropDownList分类,但又不想换页(postback)时使用
      

  3.   

    UpdatePanel不是万能的,没有UpdatePanel是万万不能的。
      

  4.   

    UpdatePanel的实现原理就是把整个页面会重新传递到服务器的,然后,服务器生成新的页,发回客户端,客户端的脚本根据UPDATEPANEL的来实现局部刷新,所以,虽然,只更新一部分,但是还是会刷新,UpdatePanel不是会节省网络的带宽的.这一点,要特别的注意,这与XMLHttpRequest只返回想要的字符是不一样的.
      

  5.   


    如果你建的ajax项目 web.config 就不用配置 
    如果是在原来项目里加 的updatepanel 就要对着 ajax项目中的web.config 来修改
      

  6.   

    如果你建的ajax项目 web.config 就不用配置 
    如果不是 就需要配置
    如果你用的是VS2008,就不需要配置,直接使用AJAX