示例#1
0
        protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
        {
            string Province = "";

            if (DropDownList1.SelectedValue != "请选择省份")
            {
                Province = " Province='" + DropDownList1.SelectedValue + "' ";
            }
            List <AreaManage> list = null;

            if (DropDownList2.SelectedValue != "请选择城市")
            {
                list = mss.GetMoArea(Province + " and City = '" + DropDownList2.SelectedValue + "'");
            }
            else
            {
                list = mss.GetMoArea(Province);
            }

            string html = "<ul>";

            foreach (AreaManage area in list)
            {
                if (area.Title != "")
                {
                    if (area.URL != "")
                    {
                        html += string.Format("<li><p><a href='{1}'>{0}</a></p></li>", area.Title, area.URL);
                    }
                    else
                    {
                        html += string.Format("<li><p><a href='Html.aspx?Id={1}'>{0}</a></p></li>", area.Title, area.Id);
                    }
                }
            }
            html += "</ul>";

            se.InnerHtml = html;
        }