当前位置: 代码迷 >> ASP.NET >> 如何获得DropDownList中的DataValueField(guid类型)
  详细解决方案

如何获得DropDownList中的DataValueField(guid类型)

热度:4257   发布时间:2013-02-25 00:00:00.0
怎么获得DropDownList中的DataValueField(guid类型)
using (OfficeChannel.OfficeChannelDataContext MyCon = new OfficeChannel.OfficeChannelDataContext(ConfigurationManager.ConnectionStrings["OfficeChannelConnectionString_Web"].ConnectionString))
  {
  var linqTxt = from i in MyCon.Class_BigType
  select new
  {
  BigId=i.classBigID,
  BigTxt = i.classBigType
  };
  DropDownList1.DataSource = linqTxt;
  DropDownList1.DataValueField = "BigId";
  DropDownList1.DataBind();

  protected void Button1_Click(object sender, EventArgs e)
  {
  //怎么获得DropDownList1.DataValueField = "BigId"的值
  }

------解决方案--------------------------------------------------------
int.Parse(DropDownList1.SelectedValue)
  相关解决方案