[Asp.net]DropDownList改变默认选中项的两种方式

海贝   2022年3月30日 浏览量:1010

https://www.cnblogs.com/wolf-sun/p/3664771.html

方式一:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Wolfy.DropDownListDemo {     public partial class Default : System.Web.UI.Page     {         protected void Page_Load(object sender, EventArgs e)
        {             DropDownListProvince.DataSource = GetList();             DropDownListProvince.DataTextField = "Name";
            DropDownListProvince.DataValueField = "ID";             DropDownListProvince.DataBind();
            RepeaterList.DataSource = GetList();             RepeaterList.DataBind();
加载中...

正在加载更多内容...

更新日期:2022年3月30日
关键字:改变默认选中项的两种方式
免责声明:文章或资料来源于网络,如有关于本文内容、版权或其它问题请于文章发表后的30日内与本网管理员联系删除或修改。

01/1|<<1>>|