FineUI 官方论坛

标题: [已解决]dropdownlist赋值出错 [打印本页]

作者: violetzone    时间: 2013-7-19 10:49
标题: [已解决]dropdownlist赋值出错
本帖最后由 violetzone 于 2013-7-19 14:10 编辑
  1. <x:DropDownList ID="DropDownList1" runat="server" Label="所属区域">
  2. </x:DropDownList>
复制代码
  1. this.DropDownList1.DataSource = pbmr.SearchPBManuRegALL();
  2. this.DropDownList1.DataTextField = "PBMR_RegName";
  3. this.DropDownList1.DataValueField = "PBMR_RegID";
  4. this.DropDownList1.DataBind();
  5. DropDownList1.Items.Insert(0, new ListItem("", ""));

  6. txt_PBC_CraName.Text = Request.QueryString["PBC_CraName"].ToString().Trim();//工序名称
  7. DropDownList2.SelectedItem.Text = Request.QueryString["PBC_SpecialCra"].ToString().Trim();//是否为特殊工序
  8. DropDownList1.SelectedItem.Text = Request.QueryString["PBMR_RegID"].ToString().Trim();//区域名称
复制代码

作者: violetzone    时间: 2013-7-19 10:51
DropDownList1.SelectedItem.Text = Request.QueryString["PBMR_RegID"].ToString().Trim();//区域名称
我前台传的PBMR_RegID是区域名称不是区域id哈 这个位置是前台的写错了 但传的是名称

主要是想把传的名称赋给dropdownlist  而且dropdownlist里有传的区域名称




欢迎光临 FineUI 官方论坛 (https://fineui.com/bbs/) Powered by Discuz! X3.4