The simplest question about defaulting file name

Discussion in 'C#' started by Asptyke, Sep 19, 2006.

  1. #1
    I've been 'parachuted' into looking after a website which uses .asp files (new to me, I've simply been using html before), and I've been through various tutorials and do understand the whole general basic idea of 'asp' but the most simple question I need to know is actually too simple for the tutorials I've been looking at so I can't get an answer from them.

    Let's put it in html terms first and the question will then be how to do it in asp
    - if I have a website on a server called for example www.asptyke.com and I put a folder in it called 'xyz' and inside the folder 'xyz' I have some html in a file called 'index.htm' then anyone using a browser and entering a webaddress of merely:

    www.asptyke.com/xyz

    will get the 'index.htm' within the folder xyz by default. So just be quoting the webaddress down to folder level, they get the default page.

    How do I work the same thing using asp? What file name do I use for the 'default' executable file when asp is in play? I just want a user to quote a subfolder like www.asptyke.com/xyz, and end up with the 'default' happening within it. This question is so basic I can't find the answer! :confused:

    Which then leads to the secondary question - what 'simple self educator' is best for learning simple tricks of asp?

    tia
     
    Asptyke, Sep 19, 2006 IP
  2. Free Born John

    Free Born John Guest

    Messages:
    111
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hi,

    you can use any filename you like as the default page, it's a parameter in IIS. By default the parameter lists about half a dozen pages (default.htm, default.asp, index.htm, index.asp etc...) and IIS uses the first one in the list that actually exists.

    I would suggest you use default.asp as that's pretty much an unwritten standard.

    regards
     
    Free Born John, Sep 19, 2006 IP
    ludwig likes this.
  3. Dabs

    Dabs Peon

    Messages:
    115
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try experimenting. usually index.* meaning index.asp might work. index.php works if there's php. Make sure there is only one default page for easier maintenance. If you put index.html and index.php and index.asp in the same folder, you might not get the response you want (it might call index.html, but your defaults may be different.)
     
    Dabs, Sep 19, 2006 IP
  4. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #4
    follow what Free Born John suggest

    check it in the IIS default document settings

    you can even make xyz.html to be the first page, default page in a directory
     
    ludwig, Sep 19, 2006 IP
  5. Asptyke

    Asptyke Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks everyone for the answers - I'll check if anyone's messed around with the default settings and switched them away from the 'obvious'.

    Any recommendations on good simple reading material to generally see little tips like this when it comes to ASP usage (and abusage!) ?
     
    Asptyke, Sep 20, 2006 IP
  6. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #6
    ludwig, Sep 20, 2006 IP
  7. Free Born John

    Free Born John Guest

    Messages:
    111
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I'd be traditional and buy a book. Most of the web resources now deal with asp.net as well as classic ASP and it can be tricky for a tyro to tell which product is being discussed.
     
    Free Born John, Sep 20, 2006 IP