Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a project, I have named my first page Login.aspx page and my second page as Default.aspx page, is there a way to make Login.aspx page be the first loaded page without changing pages nams. as you know web browser look for Default or Index page to loadup.
Posted

Its very simple all u have to do is select the page to whom u wana keep the starting page in the solution explorer, and then right click the page ur case Login.aspx and select Set As Start Page and ur done

do rate my anser once you find it useful

Thanks & Regards
Radix :rose:
 
Share this answer
 
Assuming you are using asp.net authentication then if the user is not logged in, the login.aspx will be the first page to display.

If you are using your own type of authentication then you need to ensure that unauthenticated requests are directed first to login.aspx.

If none of this sufficient for you, then you need to modify the settings for the website in IIS to make login.aspx this first page displayed; however, this should not be necessary and should be handled as above.
 
Share this answer
 
Hello
Just Go To The "Solution Explorer" in the .net frame work
and right on the "Login.aspx" and click to the Set As Start Up Page
then run your project.
 
Share this answer
 
if you want to deploy on windows server you have to made some changes in iis for login.aspx as default page of your site.
 
Share this answer
 
The simple basic way to make your Login.aspx as the Start Page in your Visual Studio IDE is: "Just right click on the file and set it as "Start Page" by clicking on the menu item "Set as Start Page".

If you deployed it in IIS, then go to the Web Application property of your IIS and set the Login.aspx as the first page and remove all the entered page name i.e. Default.aspx, Default.html etc.

Yup, by default your code should redirect your user to the Login.aspx page if he is accessing the protected page without authentication. If you are using FormsAuthentication it is simple enough. But if you are using Session only then create a base class for the page and there onPageLoad check whether the session for the user is there. If not redirect him to Login.aspx.

In this case, just change the base class of each of the page to your base class & that class must inherit from Page class.

If this answers your query please "Mark As Answer". Let me know, if you have any queries. :thumbsup:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900