Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Membership.GetUser() method returns null

Posted on 2009-02-10
3
Medium Priority
?
1,083 Views
Last Modified: 2013-12-17
I am using forms authentication....and trying to lockdown a folder using roles.


Membership.GetUser() return null when web.config is <deny users="?"/>
but works fine when web.config   <deny users="*"/>

Why is this?

0
Comment
Question by:mugsey
  • 2
3 Comments
 
LVL 7

Expert Comment

by:nkhelashvili
ID: 23599746
"*" will deny all users, and "?"  will deny anonymous users

http://msdn.microsoft.com/en-us/library/8aeskccd(VS.80).aspx
0
 

Author Comment

by:mugsey
ID: 23599846
Yes but I do authenticate

this code is executing fine

 if (Membership.ValidateUser(LoginUserName, LoginPassword))
        {            
            e.Authenticated = true;            
        }
0
 
LVL 7

Accepted Solution

by:
nkhelashvili earned 2000 total points
ID: 23599894
and have you checked Membership.GetUser() in the code?

 if (Membership.ValidateUser(LoginUserName, LoginPassword))
        {  
            // check Membership.GetUser()  here because setting e.Authenticated  to true
            e.Authenticated = true;            
        }
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question