当我复制我的应用程序的任何URL它没有登录运行如何控制它。 [英] When I Copy The Any Url Of My Application Its Running Without Login How To Control It.

查看:60
本文介绍了当我复制我的应用程序的任何URL它没有登录运行如何控制它。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我复制我的应用程序的任何url时,它的运行没有登录如何控制它。

when i copy the any url of my application its running without login how to control it.

推荐答案

这取决于你如何在web中处理身份验证现场。

您可以做的是检查用户是否在页面加载方法中进行了身份验证,如果未经过身份验证,则会重定向到登录页面。



for例如,如果您使用表单身份验证,则可以在页面加载方法中执行以下操作



it is depend on how you handle the authentication in your web site.
What you can do is check for user authenticated or not in your page load method and redirect to login page if not authenticated.

for example if you using form authentication, you can do as below in page load method

if(!this.Context.User.Identity.IsAuthenticated)
{
  Respose.Redirect("~/LoginPage.aspx");
}


这篇关于当我复制我的应用程序的任何URL它没有登录运行如何控制它。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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