国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

權限維護的一個popup畫面

2019-11-17 01:55:21
字體:
來源:轉載
供稿:網友
權限維護的一個popup畫面

1.權限以menu表為準為動態

        /// <summary>        /// 畫面數據綁定        /// </summary>        PRotected void Bind()        {            try            {                LOG.Debug("[Bind]執行開始。");                string strRoleKey = "";                string strRoleName = "";                string strMenuIds = "";                string[] MenuId;                Sys_MenuBusiness bllSysMenu = new Sys_MenuBusiness();                DataSet menuDs = new DataSet();                menuDs = bllSysMenu.GetMenuList();                for (int countRow = 0; countRow < menuDs.Tables[0].Rows.Count; countRow++)                {                    TableRow row = new TableRow();                    //label                    TableCell cell1;                    cell1 = new TableCell();                    Label lblMenuName = new Label();                    lblMenuName.ID = "lblMenuName" + countRow.ToString();                    lblMenuName.Attributes.Add(  "Name","lblMenuName" + countRow.ToString());                    lblMenuName.Text = menuDs.Tables[0].Rows[countRow]["MenuName"].ToString();                    lblMenuName.Font.Size = 9;                    cell1.Controls.Add(lblMenuName);                    row.Cells.Add(cell1);                    //checkbox                    TableCell cell2;                    cell2 = new TableCell();                    CheckBox cbxMenuName = new CheckBox();                    cbxMenuName.ID = "cbxMenuName" + menuDs.Tables[0].Rows[countRow]["MenuId"].ToString();                    //模式為更新,綁定當前角色權限數據                    if (model != "0")                    {                        //獲取更新RoleKey                        string RoleKey = "";                        if (Request.QueryString["RoleKey"] != null)                        {                            RoleKey = Request.QueryString["RoleKey"].ToString();                        }                        //獲取更新RoleKey數據                        Sys_RoleBusiness bll = new Sys_RoleBusiness();                        DataSet ds = new DataSet();                        ds = bll.GetKeyRoleList(RoleKey);                        strRoleKey = ds.Tables[0].Rows[0]["RoleKey"].ToString();                        strRoleName = ds.Tables[0].Rows[0]["RoleName"].ToString();                        strMenuIds = ds.Tables[0].Rows[0]["MenuIds"].ToString();                        if (ds.Tables[0].Rows[0]["IsActivity"].ToString().ToUpper() == "TRUE")                        {                            ddlIsActivity.SelectedValue = "1";                        }                        else                        {                            ddlIsActivity.SelectedValue = "0";                        }                        MenuId = strMenuIds.Split(',');                        hidRoleKey.Value = strRoleKey;                        txtRoleName.Text = strRoleName;                        for (int count = 0; count < MenuId.Length; count++)                        {                            if (menuDs.Tables[0].Rows[countRow]["MenuId"].ToString() == MenuId[count])                            {                                cbxMenuName.Checked = true;                                break;                            }                        }                    }                                        cell2.Controls.Add(cbxMenuName);                    row.Cells.Add(cell2);                    tbMenuIds.Rows.Add(row);                }                LOG.Debug("[Bind]執行結束。");            }            catch (Exception ex)            {                LOG.Error(ex.Message);            }        }

2.彈出子畫面時候需要禁用父頁面,選用showModalDialog()

問題一:子畫面更新后關閉window.opener=null;window.close();無提示框彈出,會彈出一個新的頁面。

解決方案:在head標簽中追加<base target="_self"/>

問題二:子畫面二次進入時保存在緩存中,不走pageload,導致數據更新后沒有重新綁定動態checkbox。

解決方案:Response.Expires = -1; 給一個過期時間,重新刷新頁面。

問題三:子畫面DB更新后頁面關閉,父頁面無刷新保持舊數據。

解決過程1:window.location.reload(); 會刷新整個頁面,有如下提示。

解決過程2:window.location.href = window.location.href; IE完成刷新父頁面,但是火狐不兼容,彈不出showModalDialog。

解決過程3:window.location.replace(url);完成火狐和IE的父頁面刷新。

3.更新獲取前臺動態checkbox,checked的ID(數字部分對應的menuID)拼接字符串逗號隔開

                string strMenuIds = "";                Sys_MenuBusiness bll = new Sys_MenuBusiness();                DataSet menuDs = new DataSet();                menuDs = bll.GetMenuList();                for (int count = 0; count < menuDs.Tables[0].Rows.Count; count++)                {                    string check = Request.Form["cbxMenuName" + menuDs.Tables[0].Rows[count]["MenuId"].ToString()];                    if (check == "on")                    {                        strMenuIds = strMenuIds + menuDs.Tables[0].Rows[count]["MenuId"].ToString() + ",";                    }                }


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 都江堰市| 乌兰浩特市| 宾川县| 冕宁县| 高州市| 兴业县| 乐平市| 元江| 常山县| 三台县| 洮南市| 仁化县| 收藏| 井陉县| 东辽县| 许昌市| 郓城县| 冷水江市| 东山县| 苏尼特左旗| 墨竹工卡县| 虞城县| 石景山区| 铜川市| 兴化市| 旬邑县| 宜昌市| 谢通门县| 泰宁县| 平武县| 丰顺县| 平乐县| 宾阳县| 东山县| 榆社县| 玛曲县| 五河县| 望谟县| 肥西县| 和平县| 邵东县|