0

I've hosted my Visual Studio project on somee.com and I'm having trouble setting it up there. I've uploaded all the files of the Visual Studio Project (data layer, lib, model layer, sln file, suo file).

I found out that in order to assign the default page you need to write that in the web config file. I've written the following lines in my web config file.

<system.webServer>
    <defaultDocument enabled="true">
        <files>
            <clear />
            <add value="www.omsshutter.somee.com/www.omsshutter.somee.com/Shutter 2000      Halloween/login.aspx"/>
        </files>
    </defaultDocument>
</system.webServer>

The login.aspx page which I want to be the default page does not come up. It's in the "Shutter 2000 Halloween" folder. How can get this working?

Sachith Perera
  • 45
  • 1
  • 11

2 Answers2

0

You need to use relative path to file instead of full HTTP path. i.e. Use following line

<add value="Shutter 2000 Halloween/login.aspx"/>

instead of

<add value="www.omsshutter.somee.com/www.omsshutter.somee.com/Shutter 2000 Halloween/login.aspx"/>

Arindam Nayak
  • 7,346
  • 4
  • 32
  • 48
  • It still doesn't help out. Even tried posting it on the default.asp file. But doesn't find the file and run it. – Sachith Perera Jan 06 '15 at 19:35
  • if you check the login.aspx, page itself throws error, so ideally you should get 500 error instead of 413 error. Now the website behave strangely, it shows blank page with some XML. – Arindam Nayak Jan 06 '15 at 19:40
0

Method 1

You can always check the user state secured/user-visible master page. If user isnt logged in from master page load simple redirect to login page (having public master page) using.

Server.Transfer("~/login.aspx");

Method 2

In your Global.asax.cs file, write the following:

public void Application_Start(object sender, EventArgs e)
{
    RouteTable.Routes routeCollection;
    routeCollection.MapPageRoute("DefaultRoute", string.Empty, "~/YourDesiredSubFolder/YourDesiredDocument.aspx");
}

Explanation:

  • Application_Start code is guaranteed to run once and only once on the application start.
  • The first line of code, gets a collection of the URL routes for your application.
  • The second line of code, defines a new route pointing to your inner page in the subfolder that you wish. The second argument is empty to indicate that this route is used when there's no specific page is requested and there's no Default document existing.
Shan Khan
  • 9,667
  • 17
  • 61
  • 111