SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Thread: ASP includes?

  1. #1
    SitePoint Member
    Join Date
    Oct 2001
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP includes?

    Is it easier imbed includes into my pages for all my ASP needs? this would seem to make more sense to keep the code and the HTML separated as much as possible.what i mean is, the script would still work the same right?
    I am new to ASP.

    Thanks

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It would, however the reality is that each time it needs to include is another call to another file which will eventually slow you right down.

    Generally only use includes for that which is common across the site. For instance:

    functions.asp
    connect.asp
    disconnect.asp

    etc (I generally only use functions.asp)
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Member
    Join Date
    Oct 2001
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gotcha, thanks

  4. #4
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On one of my sites, I have 4 includes:

    functions.asp - holds all my functions and classes I use on the site.
    top.asp - the very top of the page, ie. menu, title etc.
    btm.asp - the bottom of the page
    content.asp - the actaul page that posts the content on the page.

    I used to use a connect and disconnent page, but I wrote a function that detected if there was a connection to the database, and then connects/disconnects accordenly.


  5. #5
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Jeremy W.
    It would, however the reality is that each time it needs to include is another call to another file which will eventually slow you right down.

    Generally only use includes for that which is common across the site. For instance:

    functions.asp
    connect.asp
    disconnect.asp

    etc (I generally only use functions.asp)
    Actually, ASP scripts are compiled and cached in memory on first request.

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I would be very interested to see the MS documentation for that as we ran an extensive series of tests on performance and found that dropping our includes to 1 (or none) increased our performance significantly (10-30%).
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  7. #7
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm no expert, but wasn't the fact that ASP.NET pages are compiled and cached touted as one of the major performance benefits of ASP.NET over ASP?

    I'm also a little confused as to how an interpreted language like VBScript is compiled (as the very term "interpreted" means that the server has to interpret the code every time it's run).

    As I say, I'm not an ASP guru by any means so any explanation would be of great interest to improve my knowledge .
    Nick Wilson [ - email - ]

  8. #8
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well, first off this isn't a .NET question. If it was .NET the amount of includes wouldn't matter as the page would be literally compiled @ first runtime (takes forever, but every page access after that is incredibly fast).

    Beyond that there isn't any compiling, besides external resources (COM components and the like).
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  9. #9
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ASP.NET does not use VBScript, it uses VB.NET, which is totally different from VBScript. Because of this, .aspx pags aren't interprated, but compiled, like JSP pages. When the .aspx page is first requested, the page is complied and held as a process in the new IIS multi-process model (bye bye multi-threaded model).

  10. #10
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    hehe, I knew I could count on you to clear me up
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  11. #11
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Newcastle, England
    Posts
    268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I wasn't very clear. I know that this isn't an ASP.NET question, and I do understand the difference between VBScript and VB.NET, having written VB for a living for 5 years. I merely thought that perhaps duckie was confusing ASP with ASP.NET, and was gently trying to point that out (hence the first paragraph, which says "if the code being compiled is a benefit of ASP.NET that ASP didn't have, then that means that ASP pages can't be compiled"; followed by the second, which says "ASP usually uses VBScript which is an interpreted language, not a compiled language, so again - how can the server compile it?").

    I'll try to word things more clearly in future .
    Nick Wilson [ - email - ]

  12. #12
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I simply could not find where I read details on compiling in classic ASP. Would you guys trust devx.com and aspalliance.com? There are references to "compiling" ASP scripts in both articles.

    http://www.devx.com/upload/free/feat...007/wd0007.asp
    http://www.aspalliance.com/wiseasp/codingstandards.asp

    The deal is, according to the article I am thinking about, "compiling" in classic ASP does not mean getting an executable binary out of your ASP script. Rather, it is stored in an optimised form which still requires interpretation.

    Ok, I may have been grossly misinformed, but if I do come across that article again I'll post it here.

  13. #13
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,123
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Optimised form?

    I'm not sure I follow, and I'm fairly sure this sounds rather off. There's interpreted... Then there's compiled. Is there optimised interpreted? What if my include calls another include which then changes? How is that cached in any way? What if my include uses specific server side resources?

    Includes are just that: Includes. It's just as if the code is written into page, but it's an external resource.

    Advantage: Don't have to repeat code
    Disadvantage: Calling external resource, especially several is tedious on the server.
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  14. #14
    SitePoint Guru
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •