BasePage.cs如何控制权限? 本帖最后由 subendong 于 2012-05-22 11:50:07 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //需检查权限的页面public partial class Questions : MyPage{ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ((SiteMaster)this.Master).CheckPermition(OES2.MyAccount.AccountRole.教师, "", 6); } }}//模板页public void CheckPermition(MyAccount.AccountRole BaseRole,string Title,int selectedIndex) { ShowTitle(Title,selectedIndex); if (BaseRole == MyAccount.AccountRole.未定义) { MainContent.Visible = true; HasErr = false; ErrorState = ""; if (MyAccount.IsAccessed(Common.AccountSession, MyAccount.AccountRole.登录用户)) { div_unreged.Style.Add(HtmlTextWriterStyle.Display, "none"); div_reged.Style.Add(HtmlTextWriterStyle.Display, "inline"); } else { div_unreged.Style.Add(HtmlTextWriterStyle.Display, "inline"); div_reged.Style.Add(HtmlTextWriterStyle.Display, "none"); } } else { if (MyAccount.IsAccessed(Common.AccountSession, BaseRole)) { MainContent.Visible = true; HasErr = false; ErrorState = ""; div_unreged.Style.Add(HtmlTextWriterStyle.Display, "none"); div_reged.Style.Add(HtmlTextWriterStyle.Display, "inline"); } else { MainContent.Visible = false; HasErr = true; ErrorState = "-1"; div_unreged.Style.Add(HtmlTextWriterStyle.Display, "inline"); div_reged.Style.Add(HtmlTextWriterStyle.Display, "none"); } } }这是我做的权限检查。 OnInit 里进行控制 足以 网站上传到空间后数据库设置 一个关于IIS,设置多个站点的问题? 用过vs2008的进,来者有分 请问哪里有支持Atlas的虚拟主机? 寻求 VS.net2005 Team Suit中文正式版 客户端取值问题~~~~ 客户的邮件系统比较慢,如何在发送邮件后就返回,避免等待。。。 请大家帮忙测试一下网站 access inner join操作语法错误 为何有这样的提示(该组件上的 GetValue 操作失败,错误代码是 0x80020005)? windows server 2008 诡异问题紧急求助 后台页面布局怎么做不用TABLE
//需检查权限的页面
public partial class Questions : MyPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
((SiteMaster)this.Master).CheckPermition(OES2.MyAccount.AccountRole.教师, "", 6);
}
}
}
//模板页
public void CheckPermition(MyAccount.AccountRole BaseRole,string Title,int selectedIndex)
{
ShowTitle(Title,selectedIndex);
if (BaseRole == MyAccount.AccountRole.未定义)
{
MainContent.Visible = true;
HasErr = false;
ErrorState = "";
if (MyAccount.IsAccessed(Common.AccountSession, MyAccount.AccountRole.登录用户))
{
div_unreged.Style.Add(HtmlTextWriterStyle.Display, "none");
div_reged.Style.Add(HtmlTextWriterStyle.Display, "inline");
}
else
{
div_unreged.Style.Add(HtmlTextWriterStyle.Display, "inline");
div_reged.Style.Add(HtmlTextWriterStyle.Display, "none");
}
}
else
{
if (MyAccount.IsAccessed(Common.AccountSession, BaseRole))
{
MainContent.Visible = true;
HasErr = false;
ErrorState = "";
div_unreged.Style.Add(HtmlTextWriterStyle.Display, "none");
div_reged.Style.Add(HtmlTextWriterStyle.Display, "inline");
}
else
{
MainContent.Visible = false;
HasErr = true;
ErrorState = "-1";
div_unreged.Style.Add(HtmlTextWriterStyle.Display, "inline");
div_reged.Style.Add(HtmlTextWriterStyle.Display, "none");
}
}
}
这是我做的权限检查。