コード例 #1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (!Main.Instance.AdminApi.IsPluginAuthorized)
            {
                HttpContext.Current.Response.Write("<h1>未授权访问</h1>");
                HttpContext.Current.Response.End();
                return;
            }

            int.TryParse(Request.QueryString["parentId"], out _parentId);
            int.TryParse(Request.QueryString["menuId"], out _menuId);
            _menuInfo = _menuId > 0 ? MenuDao.GetMenuInfo(_menuId) : new MenuInfo();

            if (IsPostBack)
            {
                return;
            }

            TbTitle.Text = _menuInfo.Title;
            if (_parentId > 0)
            {
                PhSettings.Visible = true;
                TbUrl.Text         = _menuInfo.Url;
                Utils.SelectListItems(DdlIsOpenWindow, _menuInfo.IsOpenWindow.ToString());
            }
            else
            {
                PhSettings.Visible = false;
            }

            BtnReturn.Attributes.Add("onclick", $"location.href='{PageMenu.GetRedirectUrl()}';return false");
        }