Solved

Default To Login.aspx

Posted on 2010-11-14
5
695 Views
Last Modified: 2012-06-21
Can someone point me in the direction of some links (or just show me on here) how to get my app to default to my login page (which uses authentication)?
0
Comment
Question by:mikesExpertExchange
  • 2
  • 2
5 Comments
 
LVL 16

Expert Comment

by:BurnieP
ID: 34132866
You can modify your web.config file like this :

<authentication mode="Forms">
    <forms loginUrl="Login.aspx">
 </authentication>
0
 
LVL 32

Expert Comment

by:ewangoya
ID: 34132888

Open IIS
Got your website and right click to select properties
Go to the documents tab and add the page you would like to be the default
Set-Default-Page.png
0
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 34133259
@Burnie: i do have that in my web.config

@ewongoya: i couldn't find that properties page,..i'm using IIS 7

let me explain a little further, i've got a folder within my sight that is called admin. it has it's own set of pages (i.e. default.aspx, login.aspx etc.) within it to allow administrative things to be done within the site,..so when the user goes to, for example: mySite/Admin
i want the login.aspx page to be the default page if they haven't already logged in...

0
 
LVL 32

Accepted Solution

by:
ewangoya earned 500 total points
ID: 34133309

You can redirect the user to the login page if they are not yet logged in.

Add this code to page_load

protected void Page_Load(object sender, EventArgs e)
{
   if (!HttpContext.Current.User.Identity.IsAuthenticated) then
      Response.Redirect(~/login.aspx);
 
}
0
 
LVL 1

Author Closing Comment

by:mikesExpertExchange
ID: 34133525
thank you. this is what i needed!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

18 Experts available now in Live!

Get 1:1 Help Now