Example #1
0
        void dlContents_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                var menuType = (EWebMenuType)e.Item.DataItem;

                var ltlImageUrl    = e.Item.FindControl("ltlImageUrl") as Literal;
                var ltlDescription = e.Item.FindControl("ltlDescription") as Literal;
                var ltlRadio       = e.Item.FindControl("ltlRadio") as Literal;

                var checkedStr = string.Empty;
                if (menuType == webMenuType)
                {
                    checkedStr = "checked";
                }

                ltlRadio.Text = $@"
<label class=""radio lead"">
  <input type=""radio"" name=""choose"" id=""choose{e.Item.ItemIndex + 1}"" value=""{EWebMenuTypeUtils.GetValue(menuType)}"" {checkedStr}>
  {EWebMenuTypeUtils.GetText(menuType)}
</label>";

                ltlImageUrl.Text =
                    $@"<img class=""cover"" src=""images/webMenu/{EWebMenuTypeUtils.GetValue(menuType)}.png"" class=""img-polaroid""><p></p>";
            }
        }
Example #2
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            if (Page.IsPostBack && Page.IsValid)
            {
                try
                {
                    //base.PublishmentSystemInfo.Additional.WX_WebMenuColor = this.tbWebMenuColor.Text;
                    //base.PublishmentSystemInfo.Additional.WX_IsWebMenuLeft = TranslateUtils.ToBool(this.rblIsWebMenuLeft.SelectedValue);

                    var menuType = EWebMenuTypeUtils.GetEnumType(Request.Form["choose"]);
                    PublishmentSystemInfo.Additional.WX_WebMenuType = EWebMenuTypeUtils.GetValue(menuType);

                    DataProvider.PublishmentSystemDAO.Update(PublishmentSystemInfo);

                    SuccessMessage("底部导航菜单风格配置成功!");
                    AddWaitAndRedirectScript(GetRedirectUrl(PublishmentSystemID));
                }
                catch (Exception ex)
                {
                    FailMessage(ex, "底部导航菜单风格配置失败!");
                }
            }
        }