我想在我的网站上增加限制.我应该遵循什么步骤来做到这一点? [英] I want to add restriction on my website. What steps should I follow to do that?

查看:76
本文介绍了我想在我的网站上增加限制.我应该遵循什么步骤来做到这一点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站有菜单主页,登录/注册,服务
如果用户未登录并单击服务"选项卡,则会出现对话框,提示您必须登录.

My webite have menu Home,Login/Register,Services
I want if user is not logged in and clicks on services tab, dialog box should appear saying you have to login.

How to do this?

推荐答案

使用表单身份验证.

在web.config
上使用类似的东西
Use Forms Authentication.

Use some thing like this at web.config

<location path="secure">
    <system.web>
      <authorization>
        <deny users="?"/>
        <deny users="jhon"/>
      </authorization>
    </system.web>
  </location>



secure是一个包含安全Web表单的文件夹.



secure is a folder which contains your secure webforms.

<authentication mode="Forms">
      <forms loginUrl="Default.aspx"

           protection="All"

           timeout="30"

           name=".ASPXAUTH"

           path="/"

           requireSSL="false"

           slidingExpiration="true"

           defaultUrl="default.aspx"

           cookieless="UseDeviceProfile"

           enableCrossAppRedirects="false" >
        <credentials passwordFormat="Clear">
          <user name="kim" password="kim@123"/>
          <user name="jhon" password="jhonn"/>
        </credentials>
      </forms>
    </authentication>


ASP.NET 2.0中的表单身份验证 [更多 [
Restricting Access to Pages[^]
Forms Authentication in ASP.NET 2.0[^]
and more[^]


使用会话概念.据我所知,这将对您有所帮助.
Use sessions concept. It will be helpful to You as per my knowledge..


这篇关于我想在我的网站上增加限制.我应该遵循什么步骤来做到这一点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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