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

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
 
G

Guest

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.
 
L

Laurent Bugnion

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
 
T

thomas

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top