MS XMLHTTP or File System Object to Get Content

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vunet

    MS XMLHTTP or File System Object to Get Content

    The friendly URLs in ASP is the goal of my project. However, in ASP
    there is no obvious page mapping as I researched compared to other
    languages. What I mean is making www.site.com?page=Home being
    www.site.com/home/.
    One of the workaround I know is to use MS XMLHTTP request on
    www.site.com/home/index.asp page which will get the HTML content of
    www.site.com?page=Home. I might replace some folder depth if needed in
    resulting HTML.
    However, there is another solution of using File System Object to get
    the file's content (HTML) and display in the same way.
    The question is:
    1) which method is most effective (fast)?
    2) are there other methods I missed?
    Thanks.
  • Evertjan.

    #2
    Re: MS XMLHTTP or File System Object to Get Content

    vunet wrote on 10 jun 2008 in microsoft.publi c.inetserver.as p.general:
    The friendly URLs in ASP is the goal of my project. However, in ASP
    there is no obvious page mapping as I researched compared to other
    languages. What I mean is making www.site.com?page=Home being
    www.site.com/home/.
    One of the workaround I know is to use MS XMLHTTP request on
    www.site.com/home/index.asp page which will get the HTML content of
    www.site.com?page=Home. I might replace some folder depth if needed in
    resulting HTML.
    However, there is another solution of using File System Object to get
    the file's content (HTML) and display in the same way.
    The question is:
    1) which method is most effective (fast)?
    2) are there other methods I missed?
    Thanks.
    Use:

    server.transfer "/myDir/mySubdir/" & request.queryst ring("page") & ".asp"


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • =?Utf-8?B?T2xkIFBlZGFudA==?=

      #3
      Re: MS XMLHTTP or File System Object to Get Content

      "Evertjan." wrote:
      Use:
      server.transfer "/myDir/mySubdir/" & request.queryst ring("page") & ".asp"
      Ummm...you have his request *BACKWARDS*.

      He *WANTS* to be able to have customers use the url

      (a so-called "friendly" or "REST-ful" url) and have them end up on


      His English is reflecting his native language, I think, but his use of
      "friendly url" is the trigger.

      From a performance perspective, the only good way to do this in ASP is with
      a URL-rewriter ISAPI plug-in for the IIS web server. I don't know of any
      free ones, though some aren't very expensive.

      If you don't mind a little bit of a performance hit, the easy way to do this
      is with a CUSTOM 404 Error Page.

      That is, you use an ASP page for your CUSTOM 404 ERROR handler (and this
      assumes that your web host *allows* you do do this! most do, but not all)
      and it simply "inspects" the value of the problem URL (that is, the
      non-existent www.mysite.com/home) and transforms it into the right format,
      again using Server.Transfer or Response.Redire ct.

      Google for "ASP Custom 404" and you'll find plenty of hits to help you.


      Comment

      • p byers

        #4
        Re: MS XMLHTTP or File System Object to Get Content

        Create a "home" folder in the site
        Make the "default.as p" in that folder do the same as the "home.asp"
        Pete (Northolt uk)

        vunet wrote:
        The friendly URLs in ASP is the goal of my project. However, in ASP
        there is no obvious page mapping as I researched compared to other
        languages. What I mean is making www.site.com?page=Home being
        www.site.com/home/.
        One of the workaround I know is to use MS XMLHTTP request on
        www.site.com/home/index.asp page which will get the HTML content of
        www.site.com?page=Home. I might replace some folder depth if needed in
        resulting HTML.
        However, there is another solution of using File System Object to get
        the file's content (HTML) and display in the same way.
        The question is:
        1) which method is most effective (fast)?
        2) are there other methods I missed?
        Thanks.

        Comment

        Working...