Solved

LoginStatus control

Posted on 2012-03-20
2
349 Views
Last Modified: 2012-06-22
I have a LoginStatus control on my site.

On logging out, on some pages, it will redirect like I want it to (those that require a user to be logged in) and on others it just refreshes the page. This is what I want.

What I want to know is "how do I add pages to the list of pages that require a user to be logged in?" On some of my newer pages it isn't redirecting them when it should. That is, they are supposed to be logged in to view that page.

I don't remember adding pages, it just seems to have known.
0
Comment
Question by:ce4LessUser
2 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 37748002
Some code might help.


Cd&
0
 
LVL 13

Accepted Solution

by:
Molnar István earned 500 total points
ID: 37877760
you can add pages that require an authentication using the web.config like this:
<!--SECURITY: USERS-->
    <location path="userprofile.aspx">
        <system.web>
            <authorization>
                <deny users="?"/>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
<!--SECURITY: ADMINISTRATORS-->
    <location path="managecategories.aspx">
        <system.web>
            <authorization>
                <allow roles="Administrator" />
                <deny users="*"/>
            </authorization>
        </system.web>
    </location>

as for the redirection, you can do :
1. setting the NavigateUrl for the login control
2. using the function : this.Response.Redirect("shoppingcart.aspx", true);

hope it helps
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now