如何在asp.net中使用身份验证和授权? [英] how to use authentication and authorization in asp.net ?

查看:78
本文介绍了如何在asp.net中使用身份验证和授权?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户正在访问网页,我想拒绝没有登录的主页访问,并且我希望用户应直接重定向到登录页面.

i want to deny the access of home page without login if users is accessing the web pages and i want that users should redirected to directly to login page.

推荐答案

将启动页面设置为登录页面.
Set startup page as Login page..


当时的用户登录将用户ID设置为会话,并在会话中未找到用户ID时添加页面加载检查.可以将用户重定向到登录页面.
When user log-in at that time set user id into session, and add check on page load if userid is not found on to session, you can redirect user to login page.


这篇关于如何在asp.net中使用身份验证和授权?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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