How to specify application default web page in web.config ?

  • Thread starter Thread starter thomas
  • Start date Start date
T

thomas

How to specify application default web page in web.config?
I mean, default web page, not a login page.
Is it possible?

Tomasz
 
This is an IIS setting. Get the properties of your application in IIS and
check out the "Documents" tab ,here you can change the default pages.
 
Hi,
How to specify application default web page in web.config?
I mean, default web page, not a login page.
Is it possible?

Tomasz

I don't think this is possible. However, you can specify the default
page for a web application using the IIS console.

With IIS7, you will be able to specify much more properties using the
web.config file, but this is not possible in IIS5 and IIS6.

Scott Guthrie has tons of interesting information about IIS:
http://weblogs.asp.net/scottgu/default.aspx

HTH,
Laurent
 
OK, so here is the answer.

With ASP.Net 2.0 it is actually very simple:

<system.web>
<urlMappings>
<add url="~/Default.aspx" mappedUrl="~/MyStartPage.aspx"/>
</urlMappings>
</system.web>

In ASP.Net 1.1 Application_BeginRequest event needs to be handled in the
Global.asax

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
If Request.RawUrl.ToUpper().IndexOf("DEFAULT.ASPX") > -1 Then
Response.Redirect("MyStartPage.aspx")
End If
End Sub

Of course, "MyStartPage.aspx" can be stored as a configurable setting in
web.config.

TJ
 
Back
Top