PDA

View Full Version : ASP.NET 4.0 how to set a page as default page


Pranay
10-27-2010, 01:12 PM
when I enter my website address, I am redirected to my login page instead of my homepage, now I put the home page address in webconfig file in the defaultpage tag in forms authentication block but not working, In default documents setting I gave my homepage highest priorty but no use.
Please help
Thanks

mjp
10-28-2010, 10:27 AM
What are the names of your login and index files?
What is the order you specified in default documents?

Pranay
10-28-2010, 11:58 AM
Login file name is Login.aspx which is in Account folder. I dont have an index file here.........can that be issue ???
well I removed everything now and only default.aspx is there in my default documents
my scenario:
When I put my address as www.website.com I should be redirected to Default.aspx page of my website instead
http://www.website.com/Account/Login.aspx?ReturnUrl=%2f.... this is what I get.
I gave permission to Default page for everyone , in IIS default documents, its on the list, in authenticaiton block of webconfig I have defaultUrl as my default page. I still cant fix this thing. I am banging my head right now.
Please help me

mjp
10-28-2010, 05:32 PM
Login file name is Login.aspx which is in Account folder. I dont have an index file here.........can that be issue ???There's a couple of things to check. First, if login is above default in the the default document list, login will be the default document. The order they are listed in determines which will be default if both are present. So, this:
login.aspx
default.aspx
is no good. It will make login.aspx the default document.

This is what you want:
default.aspx
login.aspx
Also, those filenames are case-sensitive. So Default.aspx is not the same thing as default.aspx.

Pranay
10-29-2010, 06:42 AM
the file names are not case-sensitive. I checked it, both locally and as well as on discountasp.net iis tool. Please let me know if I am wrong but I guess file names are not case sensitive. Still banging my head with that problem.
Its working fine locally, exactly the way it should but for some reason on discountasp.net server it just pops up the login page instead of my home page. Login is not even in index list. I have just my homepage there.
Anymore suggestions.
Thanks

mjp
10-29-2010, 03:24 PM
If login isn't in your default document list, then it would seem that something is redirecting to login.aspx. Do you still have defaultpage in your web.config, or did you remove it?

The server wouldn't send a request for domain.com to domain.com/login.aspx unless login.aspx was the default, or there was a redirect in place.