473,394 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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.
Jun 27 '08 #1
3 2166
vunet wrote on 10 jun 2008 in microsoft.public.inetserver.asp.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.querystring("page") & ".asp"
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 27 '08 #2
"Evertjan." wrote:
Use:
server.transfer "/myDir/mySubdir/" & request.querystring("page") & ".asp"
Ummm...you have his request *BACKWARDS*.

He *WANTS* to be able to have customers use the url
http://www.mysite.com/home
(a so-called "friendly" or "REST-ful" url) and have them end up on
http://www.mysite.com/index.asp?page=home

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

Google for "ASP Custom 404" and you'll find plenty of hits to help you.
Jun 27 '08 #3
Create a "home" folder in the site
Make the "default.asp" 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.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dan Sikorsky | last post by:
Uploading from browser to server using Msxml2.XMLHTTP takes a long time about 15 minutes for a 1.5MB file at 37.2Kbps, although it does get there. Is there anyway to speed things up? here's the...
6
by: Krzysztof Kubiak | last post by:
I'm trying to make use of XMLHTTP object, but I've come across a problem. It seems that there is no way to create dynamic array of such XMLHTTP objects (to make several requests) and handle them...
3
by: kajol | last post by:
Hi everyone I am trying to get the content of any webpage (URL) using XMLHTTP, and it is working fine for me, but suddenly I have got a URL "http://www.bizrate.com/" which is causing a system...
3
by: Steven Burn | last post by:
The application; Service on my webserver that allows a user to upload their HOSTS file for functions to verify the contents are still valid. Uses; 1. XMLHTTP (MSXML2) 2. FileSystemObject...
2
by: Kapil Shah | last post by:
Hello Everybody, I am trying to develop code to use the correct version of XMLHTTP and use it to send SOAP envelope to WebService . The code works fine for the first time but then after that I get...
3
by: Mark | last post by:
Hi all i was just wondering if you help. I have to send a cgi request to a company using xmlhttp request. They reply back with a line of info but when you view the internet explorer source code...
4
by: sfslug | last post by:
Hello. I'm using xmlhttp in a windows application to return xml data. The xml data is returned successfully, but I get errors when I try loading the xmlhttp response object to a dataset. I can...
1
by: cwl | last post by:
I want to get the content of a webpage containing plain text and write the content to a text file. My code looks like this: Set xmlhttp = CreateObject("Microsoft.XMLHTTP")...
0
by: SushiSean | last post by:
When executing the xmlhttp.send function to request shipper for available shipments (I send xml as string and receive result xml): XMLHTTP xmlhttp = new XMLHTTP(); xmlhttp.open("POST",...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.