Using <% %> blocks

Results 1 to 2 of 2

Thread: Using <% %> blocks

  1. #1
    Join Date
    Dec 1969

    Default Using <% %> blocks

    With ASP, I kept seeing articles warning to go in and out of ASP code blocks as little as possible, so I did. It&#039;s a real pain when dynamically writing HTML, etc., though. Is this still an issue with .NET? All the code samples I&#039;ve seen from MS use the code blocks quite liberally. Was this really even an issue with ASP? TIA<BR><BR> Tom

  2. #2
    Tony Guest

    Default RE: Using <% %> blocks

    I can&#039;t answer your question from a .NET standpoint, but from a classic ASP standpoint I can. As it turns out, all the fear of context-switching wasn&#039;t really well-founded. In theory it would slow down performance, but in practice the ASP content gets cached and so your performance hit is only experienced the first time you pull the page up in your browser. After that, reference is made to the cached information and no real performance degradation is experienced.<BR><BR>There may be some out there who would disagree, but I have found this to be absolutely true through extensive testing. Bottom-line: Don&#039;t worry about context-switching in classic ASP.<BR><BR>I would assume that the same is true for .NET, but I cannot say for sure as I have not tested this in that environment. Hopefully someone else out there will be able to answer that part of your question.<BR><BR>~~ Tony

Posting Permissions

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