简体   繁体   English

Asp.net登录控件

[英]Asp.net Login Control

I have a web application that I use Login Control and ASP.net membership for Sign in process. 我有一个Web应用程序,我在登录过程中使用登录控制和ASP.net成员身份。 my application work propebly untill last week I upload new version, in this version I didnt change the login UC and just the main page ( default page after user logged in ) changed. 我的应用程序正常工作,直到上周我上传了新版本,在此版本中,我没有更改登录UC,只是更改了主页(用户登录后的默认页面)。

but some users report me they cant login and redirect to Login page. 但是一些用户向我报告他们无法登录并重定向到“登录”页面。 some note: 1- this problem occure just in IE browser 2- users that report this problem can login to old version 一些注意事项:1-仅在IE浏览器中发生此问题2-报告此问题的用户可以登录到旧版本

I add a log procedure and see users redirected becuase of this code 我添加了一个日志过程,并由于此代码而看到用户重定向

if (!this.User.Identity.IsAuthenticated)
{
    Response.Redirect("~/Secure/Signin.aspx");
}

I checked and see this.User.Identity.Name was empty or null. 我检查了一下,发现this.User.Identity.Name为空或为空。

What setting maybe changed? 什么设置可能会改变?

Thanks 谢谢

I've seen a similar thing happen when there was a malformed FORM tag was rendered inside my ASP.Net Server FORM tag. 当我的ASP.Net Server FORM标记内呈现格式错误的FORM标记时,我已经看到类似的事情发生。 By 'malformed' I mean that it was missing the required METHOD attribute. “格式错误”是指它缺少必需的METHOD属性。

It is my understanding that the HTML spec doesn't support nested FORM tags, so different browsers handle them differently. 据我了解,HTML规范不支持嵌套的FORM标签,因此不同的浏览器对它们的处理方式也不同。 In my case, I saw a similar issue as you describe, with no issues in Firefox, and major issues in IE. 就我而言,我看到了您所描述的类似问题,Firefox中没有问题,而IE中有重大问题。

Check to ensure there are no Nested FORM tags on your page. 检查以确保页面上没有嵌套的FORM标签。 Also check all FORM tags to ensure they have all required attributes. 还要检查所有FORM标签,以确保它们具有所有必需的属性。

Doubt this will solve the problem, it's kind of tangental. 怀疑这将解决问题,这是切线的。 But, rather than hand coding the redirect url it's poosible to use 但是,与其手动编码重定向网址,不如使用

FormsAuthentication.RedirectToLoginPage()

which has the benefit of taking care of the returnUrl and stuff. 这具有照顾returnUrl和东西的好处。 It'd require the login Url set in the web.config. 需要在web.config中设置登录网址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM