Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

LoginStatus control

Posted on 2012-03-20
2
Medium Priority
?
358 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

916 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