I'm very strange for me, I started developing a web site in Visual Studio 2010 and ended in 2012. This is VB.NET, Framework 4.0. During the Web site, I use Request.ServerVariables ("LOGON_USER"). Everything works just as it should be.
I have recently started developing another web site from the beginning of 2012. What happens is the request. Whitelist ("LOGON_USER") does not return any value! It's just empty! However, if I open this same application with Visual Studio 2010, then it works!
Can anyone tell me what is happening here and how can I fix it in VS 2012? Thanks!
This problem occurs because the authentication-related variables in the ServerVariables store are not populated. Use anonymous access protection to access the aspx page. This problem can also occur when you give an anonymous user access to the section of the Web.config file.
To populate the LOGON_USER variable, when you use any authentication mode other than anyone, you can deny access to an anonymous user in the section of web.config.
Just change the authentication mode to anything other than the Web.config file. For example, the following entry in the Web.config file sets the authentication mode for form-based authentication: < / P>
& lt; Authentication mode = "form" / & gt; & Lt ;! - To deny access to the anonymous user in Web.config file, use the following syntax: -! & Gt; & Lt; Authority & gt; & Lt; Deny users = "?" / & Gt; & Lt ;! - This anonymous / unregistered user - & gt; & Lt; Allow users = "*" /> & Lt ;! - This allows access to all registered users - & gt; & Lt; / Authorization & gt;
I'm not sure that this is a VS 2010 & amp; 2012, but before that this has happened to me, and I used the above steps to remedy it. Like I said, just your web Check config file!
Answer this question for your questions!
No comments:
Post a Comment