473,662 Members | 2,454 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2171
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)
Jun 27 '08 #2
"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
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.Redire ct.

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.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.
Jun 27 '08 #4

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

Similar topics

3
12448
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 code ... var sFilename = (document.form1.myFileName.value); // create ADO-stream Object var ado_stream = new ActiveXObject("ADODB.Stream"); // create XML document with default header and primary node
6
3254
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 properly. I was trying to use such code: <script lang="javascript"> function handleOnReadyStateChange() { if (this.readyState==4) {
3
1984
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 error and the error is System.Runtime.InteropServices.COMException(0xC00CE56E): System error:- 1072896658
3
2280
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 3. CrazyBeavers Upload control (couldn't get the Dundas one to work)
2
481
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 an error that objHttp(XMLHTTP) is null or not an object. Pls guide where I am going wrong? Rahil <script language="jscript"> var objXmlDoc;
3
3089
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 you see the XML format. I was just wonder if anyone could help me save the xml format to a xml file. I woul like to show you my code but there is to much confidential information about the company.
4
1790
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 write the xml to a file & read that in to a dataset, but what fun is that? --------------- code: xmlhttp = New MSXML2.XMLHTTP xmlhttp.open("POST", strUrl, False) xmlhttp.setRequestHeader("Content-Type", "text/xml") xmlhttp.Send("...request ...")
1
14520
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") xmlhttp.setRequestHeader "Content-type","text/txt" xmlhttp.Open "get", "http://www.mysite.com/default.asp", False xmlhttp.Send text = xmlhttp.responseText dim fs, fname
0
2742
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", "https://gateway.fedex.com:443/GatewayDC", false, "", ""); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send(strXML);
0
8343
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8856
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8545
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7365
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6185
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4179
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.