表单身份验证测试代码... [英] Form Authentication testing code...

查看:90
本文介绍了表单身份验证测试代码...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读以下页面来制定表单身份验证:
http://www.asp.net/web-forms/tutorials/security/introduction/forms-authentication-configuration-and-advanced-topics-cs
一切正常,直到我到达将信息写入UserData"部分,我将代码复制到VS 2010并运行该应用程序,但是当我输入用户名和密码时,页面会重新加载default.aspx,但仍然无法登录,

I,m working out form authentication by reading this page:
http://www.asp.net/web-forms/tutorials/security/introduction/forms-authentication-configuration-and-advanced-topics-cs
everything was ok till I reach to "Writing Information to UserData" section, I copy the code to VS 2010 and run the app, but when I input the username and password, page reload the default.aspx and still I''m not login,
where I''m wrong you think?

推荐答案

首先,您怎么知道您尚未登录? 其次,如果您确实做了他们所做的事情,那么恰好又被重定向到default.aspx,这是对的,为什么?
仅仅是因为未设置web.config文件中的defaultUrl属性,那么defaultUrl属性是什么?
它是您经过身份验证后将重定向到的页面,如果您未设置它,您将被重定向到您的主页,我认为它是default.aspx,因此请确保将此属性设置为您想要的页面
First how do you know you are not logged in???
Second if you did exactly what they do that is the right thing to happen to be redirected again to the default.aspx,why?
simply because the defaultUrl property in the web.config file hasn''t been set, so what is the defaultUrl property?
it''s the page that you will be redirected to after being authenticated and if you dont set it you will be redirected to your home page which I think the default.aspx, so make sure you set this property to the page you want


这篇关于表单身份验证测试代码...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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