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
Solved

LoginStatus control

Posted on 2012-03-20
2
352 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 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