📄 mstadmin.master.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Admin_mstAdmin : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
string strScriptBlock;
if (Session["User"] == null)
{
strScriptBlock = @"alert(""您没有登陆!"");window.navigate(""Login.aspx"");";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "NotLoging" + this.UniqueID, strScriptBlock, true);
}
else if (((eNewsUser)Session["User"]).NewsUserPrivilege < 1)
{
strScriptBlock = @"alert(""您的权限不足!"");window.navigate(""~/default.aspx"");";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "NotLoging" + this.UniqueID, strScriptBlock, true);
}
else if (((eNewsUser)Session["User"]).NewsUserPrivilege < 2)
{
strScriptBlock = @"alert(""您的权限不足!"");window.navigate(""default.aspx"");";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "NotLoging" + this.UniqueID, strScriptBlock, true);
}
else
{
if (!IsPostBack)
{
DataTable dt = (DataTable)Application["Items"];
TreeNode tn;
for (int intCounter = 0; intCounter < dt.Rows.Count; intCounter++)
{
tn = new TreeNode();
tn.NavigateUrl = "showItem.aspx?itemid=" + Convert.ToString(dt.Rows[intCounter]["NewsItemID"]);
tn.Text = dt.Rows[intCounter]["NewsItemName"].ToString();
tvNavigate.Nodes[0].ChildNodes.Add(tn);
}
}
}
}
protected void lbLogOff_Click(object sender, EventArgs e)
{
Session.Clear();
string strScriptBlock = @"alert(""谢谢您的登录!"");window.navigate(""login.aspx"");";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "LogOff" + this.UniqueID, strScriptBlock, true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -