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

Discussion in 'ASP .Net' started by thomas, Oct 11, 2006.

  1. thomas

    thomas Guest

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

    Tomasz
     
    thomas, Oct 11, 2006
    #1
    1. Advertising

  2. 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.
     
    =?Utf-8?B?R2F1cmk=?=, Oct 11, 2006
    #2
    1. Advertising

  3. Hi,

    thomas wrote:
    > 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
    --
    Laurent Bugnion, GalaSoft
    Software engineering: http://www.galasoft-LB.ch
    PhotoAlbum: http://www.galasoft-LB.ch/pictures
    Support children in Calcutta: http://www.calcutta-espoir.ch
     
    Laurent Bugnion, Oct 11, 2006
    #3
  4. thomas

    thomas Guest

    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
     
    thomas, Oct 12, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TaeHo Yoo
    Replies:
    2
    Views:
    373
    TaeHo Yoo
    Jul 29, 2003
  2. Siegfried Heintze

    How to specify roles in web.config file

    Siegfried Heintze, Apr 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,106
    Steve C. Orr [MVP, MCSD]
    Apr 2, 2004
  3. =?Utf-8?B?bGVueWFkbw==?=
    Replies:
    2
    Views:
    435
    =?Utf-8?B?bGVueWFkbw==?=
    May 20, 2005
  4. CSharpner
    Replies:
    0
    Views:
    1,129
    CSharpner
    Apr 9, 2007
  5. Morgan Cheng
    Replies:
    2
    Views:
    800
    =?Utf-8?B?UGFnZSBCcm9va3M=?=
    Apr 27, 2007
Loading...

Share This Page