Solved

LoginStatus control

Posted on 2012-03-20
2
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
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 the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
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 …
Suggested Courses

623 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