省市的数据通过服务取值后缓存于服务器缓存DataSet的table1,table2表中其中table1有所有省份的数据,table2中有所有省份下的县市数据并与table1中ID关联问:怎么不刷新整页的情况下选择"省份"后绑定相应的"县市"数据
望能详细说明谢谢

解决方案 »

  1.   

    ajax...客户端在选择省份的动作进行后,调webservice的方法,获取对应县市数据
      

  2.   

    整个丢在<updataPanel>里面!
      

  3.   

    UpdatePanel,很简单的,将事件绑定成异步回调即可,楼主自己去扩展代码前台<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="JavaScript._Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:DropDownList ID="DropDownList1" runat="server"  Width="200px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                <asp:ListItem Value="1" Text="1"></asp:ListItem>
                <asp:ListItem Value="2" Text="2"></asp:ListItem>
                <asp:ListItem Value="3" Text="3"></asp:ListItem>
                <asp:ListItem Value="4" Text="4"></asp:ListItem>
            </asp:DropDownList>
            <br />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:DropDownList ID="DropDownList2" runat="server" Width="200px">
                        <asp:ListItem Value="1" Text="1"></asp:ListItem>
                        <asp:ListItem Value="2" Text="2"></asp:ListItem>
                        <asp:ListItem Value="3" Text="3"></asp:ListItem>
                        <asp:ListItem Value="4" Text="4"></asp:ListItem>
                    </asp:DropDownList>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="SelectedIndexChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
        </form>
    </body>
    </html>后台:using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;namespace JavaScript
    {
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {        }        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
            {
                DropDownList2.SelectedValue = DropDownList1.SelectedValue;
            }
        }
    }
      

  4.   

    数据库操作效率不好。使用XML。。去下载一个。刷新问题。放到UpdatePanel就行了。谢谢