|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
concerning: cost of includes vs. Server.Execute
Hi!
Im scripting for a site that has a lot of includes. Im trying to optimize and make things faster - since the site has unique 20000 visitors a day... My question is: <!--#include file="somefile.inc"--> more expensive to use than: Server.Execute ("somefile.inc") In terms of memory and cpu? Any comments with pros and cons would be a great help. Im working on ASP3 and an IIS4 *damnit* |
|
#2
|
|||
|
|||
|
You question is easily answered if you have IIS4 - IIS4 doesn't support server.execute
![]() |
|
#3
|
|||
|
|||
|
OMG u are rigth...
I get: Microsoft VBScript runtime error '800a01b6' Object doesn't support this property or method: 'Server.Execute' /include_test.asp, line 8 My test IIS is a 5.... *doh* Heres the thing: I would like to build the new pages depending on the querystring. eg. include_test.asp?page="index" and then include on the basis of that alá: Dim includepage includepage = Request("page")& ".inc" <!-- #include file="<% Response.Write ("includepage")%>"--> But thats wont work since it seems the engine first make the includes and then parses the string- are there any workarounds to this problem. It must be a common one *the noob was hoping* And while Im at it - is there an asp3 api like the one for php? I have a hard time finding a complete api descibing the functions for asp3 and vbscribt. Ive found theese two are there any better ones?? URL URL |
|
#4
|
|||
|
|||
|
First, included pages are added to the overall code base of an asp page before any asp processing happens, so you can't dynamically determine which file to include.
I use documentation direct from the source: http://msdn.microsoft.com/library/e...m/ref_vbom_.asp http://msdn.microsoft.com/library/e...echnologies.asp |
|
#5
|
|||
|
|||
|
Read this article from 4guysfromrolla about Simulating Server.Execute and Server.Transfer
|
|
#6
|
|||
|
|||
|
Server.execute was only made available in ASP 3.0, otherwise you have to use the include tag, both basically do the same thing but with server.execute the name of the file can be dynamic and will only executed if you tell it to be. With includes the file is processed first before the rest of the page is processed
|
|
#7
|
||||
|
||||
|
If i may add my two cents in as well...
You may want to consider changing your .inc extension to .asp. You'll note that if you view a .inc page directly in a browser you see everything in plain text but the .asp of the same information will not be shown to the user without the proper server side execution.
__________________
mr... mike.rusaw@realpage.com RalPage, Inc. "I have made this letter longer than usual, only because I have not had the time to make it shorter." - Blaise Paschal |
|
#8
|
|||
|
|||
|
of course you may, we'd love your 2 cents.... =)
mrusaw brings up a good point, but on the otherside, here's my question, why would it be a good idea to make a file .inc file? I tend to make them all asp as you sugguest or set .inc's to be interpreted by the server. is there any advantage to allowing .inc's or someother type of extention to be downloaded? |
|
#9
|
|||
|
|||
|
Using the .inc extension is probably just a holdover from the InterDev 1.0 days when the dataform wizard created .inc files. There were some Microsoft KB articles that indicated .inc was a common file extension for include files in those days.
I kinda wish MS had kept that dataform wizard in InterDev 6 though ![]() |
|
#10
|
||||
|
||||
|
Well, I have heard the arguement that some people use the .inc so that they can create user modules (modules with stuff entered by users) and then uses those .inc's in their program. Their theory is that this is "more secure." I totally disagree with this since the code is included into a .asp which executes the entire page of code.
Another disadvantage of the .inc is that you loose intellisense and "pretty" (he-he) coloring of the Studio IDE . |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > concerning: cost of includes vs. Server.Execute |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|