protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack) { return; } int navigationType = RequestHelper.GetQueryString <int>("navigationType"); int id = RequestHelper.GetQueryString <int>("Id"); NavigationInfo navigation = new NavigationInfo(); if (id > 0) { navigation = NavigationBLL.Read(id); navigationType = navigation.NavigationType; } //导航类别 ddlNavigationType.DataSource = EnumHelper.ReadEnumList <NavigationType>(); ddlNavigationType.DataTextField = "ChineseName"; ddlNavigationType.DataValueField = "Value"; ddlNavigationType.DataBind(); ddlNavigationType.Text = navigationType.ToString(); //父类导航 int curNavigation = int.Parse(ddlNavigationType.Text); ddlParent.DataSource = NavigationBLL.ReadFatherList(curNavigation); ddlParent.DataTextField = "Name"; ddlParent.DataValueField = "Id"; ddlParent.DataBind(); ddlParent.Items.Insert(0, new ListItem("父级导航", "0")); //内容ID ClassId.DataSource = ClassRelation.Read(); ClassId.DataTextField = "Name"; ClassId.DataValueField = "VirtualId"; ClassId.DataBind(); ClassId.Items.Insert(0, new ListItem("--请选择--", "0")); //显示方式 radioNavigationShowType.DataSource = EnumHelper.ReadEnumList <NavigationShowType>(); radioNavigationShowType.DataTextField = "ChineseName"; radioNavigationShowType.DataValueField = "Value"; radioNavigationShowType.DataBind(); LinkTypeForCustom.Visible = false; IsVisible.Text = "1"; if (id > 0) { ddlParent.Text = navigation.ParentId.ToString(); radioNavigationShowType.Text = navigation.ClassType.ToString(); LinkType.Text = navigation.ClassType.ToString(); LinkTypeForURL.Visible = navigation.ClassType == (int)NavigationClassType.Url; LinkTypeForCustom.Visible = navigation.ClassType != (int)NavigationClassType.Url; ShowTypeForCustom.Visible = !navigation.IsSingle; radioIsSingle.Text = navigation.IsSingle.ToString().ToLower(); radioNavigationShowType.Text = navigation.ShowType.ToString(); Name.Text = navigation.Name; Remark.Text = navigation.Remark; OrderId.Text = navigation.OrderId.ToString(); URL.Text = navigation.Url; ClassId.Text = navigation.ClassId.ToString(); IsVisible.Text = navigation.IsVisible.ToString().ToLower(); } }