管理员代码 [英] admin code

查看:448
本文介绍了管理员代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是ASP.NET的新手.
我的任务是通过检查数据库(SQL Server)中的状态来创建具有不同角色(用户,管理员),管理模块的博客,反之亦然
数据库表具有3列:

Hi

I''m very new to ASP.NET.
My task is to create a blog with different role''s (users,admin), a admin module by checking status in the database (sql server) and vice versa
The database table has 3 columns:

name
password
status


根据数据库中的状态,必须将页面重定向到管理页面或用户页面


According to the status in the database the page must be redirected to admin page or users page

If status = A  //(admin page)
If status = U  //(users page)



任何人都可以帮助我..急切的



Can any one please help me.. its urgent

推荐答案

您为什么不清楚地问自己的问题?没有适当的问题,您将无法获得答案.无论如何要指出重点.

登录时,根据用户角色&从数据库获取状态值.将状态值存储在Session&然后根据状态值重定向到页面.

尝试使用示例代码进行重定向
Why don''t you asked your question clearly? Without proper question you can''t get answer. Anyway come to the point.

While login get the status value from database based on user role & store the status value in Session & then redirect to pages based on status value.

Try the sample code for redirections
if(Session["Status"] == "A")
{
  Response.Redirect("adminpage.aspx");
}
else if(Session["Status"] == "U")
{
  Response.Redirect("userpage.aspx");
}


这篇关于管理员代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆