//初始化链接类别 public void InitLinkType() { try { DropLinkType.DataSource = LinkTypeBll.GetLinkTypeList(); DropLinkType.DataTextField = "LinkName"; DropLinkType.DataValueField = "LinkId"; DropLinkType.DataBind(); } catch (Exception ex) { throw new Exception(ex.Message); } }
//链接类别 public void SetLinkType() { try { DropLinkType.DataSource = LinkTypeBll.GetLinkTypeList(); DropLinkType.DataValueField = "LinkId"; DropLinkType.DataTextField = "LinkName"; DropLinkType.DataBind(); ListItem item = new ListItem(); item.Text = "请选择类别"; item.Value = "0"; DropLinkType.Items.Insert(0, item); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void LoadLinkType() { try { Tz888.BLL.Link.LinkTypeTab LinkType = new Tz888.BLL.Link.LinkTypeTab(); DropLinkType.DataSource = LinkType.GetLinkTypeList(); DropLinkType.DataTextField = "LinkName"; DropLinkType.DataValueField = "LinkId"; DropLinkType.DataBind(); ListItem item = new ListItem(); item.Text = "-请选择-"; item.Value = "-1"; DropLinkType.Items.Insert(0, item); } catch (Exception ex) { throw new Exception(ex.Message); } }