ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 6th, 2003, 12:10 PM
toerning toerning is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 toerning User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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*

Reply With Quote
  #2  
Old August 6th, 2003, 07:03 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 13th Plane (11000 - 11499 posts)
 
Join Date: Jun 2003
Posts: 11,234 Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 7 h 12 m 7 sec
Reputation Power: 909
You question is easily answered if you have IIS4 - IIS4 doesn't support server.execute

Reply With Quote
  #3  
Old August 7th, 2003, 03:21 AM
toerning toerning is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 toerning User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old August 7th, 2003, 12:56 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 13th Plane (11000 - 11499 posts)
 
Join Date: Jun 2003
Posts: 11,234 Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 7 h 12 m 7 sec
Reputation Power: 909
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

Reply With Quote
  #5  
Old September 13th, 2003, 01:44 PM
Kokopelli Kokopelli is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 Kokopelli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Read this article from 4guysfromrolla about Simulating Server.Execute and Server.Transfer

Reply With Quote
  #6  
Old September 14th, 2003, 12:10 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
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

Reply With Quote
  #7  
Old September 15th, 2003, 06:35 PM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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

Reply With Quote
  #8  
Old September 15th, 2003, 06:57 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
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?

Reply With Quote
  #9  
Old September 15th, 2003, 09:27 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 13th Plane (11000 - 11499 posts)
 
Join Date: Jun 2003
Posts: 11,234 Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level)Doug G User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 7 h 12 m 7 sec
Reputation Power: 909
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

Reply With Quote
  #10  
Old September 16th, 2003, 10:00 AM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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 .

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > concerning: cost of includes vs. Server.Execute


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |