Solved

Default To Login.aspx

Posted on 2010-11-14
5
689 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

14 Experts available now in Live!

Get 1:1 Help Now