Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 54055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:09:36+00:00 2026-05-10T17:09:36+00:00

Bearing in mind this is for classic asp Which is better, all HTML contained

  • 0

Bearing in mind this is for classic asp

Which is better, all HTML contained within Response.Write Statements or inserting variables into HTML via <%= %>.
Eg

Response.Write '<table>' & vbCrlf Response.Write '<tr>' &vbCrLf Response.Write '<td class=''someClass''>' & someVariable & '</td>' & vbCrLf Response.Write '</tr>' & vbCrLf Response.Write '</table>' & vbCrLf 

VS

<table>   <tr>      <td class='someClass'><%= someVariable %></td>   </tr> </table> 

I am mainly asking from a performance point of view in which will have the least server impact when there multiple variables to insert?

If there are no technical differences what are the arguments for one over the other?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:09:37+00:00Added an answer on May 10, 2026 at 5:09 pm

    First, The most important factor you should be looking at is ease of maintenance. You could buy a server farm with the money and time you would otherwise waste by having to decipher a messy web site to maintain it.

    In any case, it doesn’t matter. At the end of the day, all ASP does is just execute a script! The ASP parser takes the page, and transforms <%= expression %> into direct script calls, and every contiguous block of HTML becomes one giant call to Response.Write. The resulting script is cached and reused unless the page changes on disk, which causes the cached script to be recalculated.

    Now, too much use of <%= %> leads to the modern version of ‘spaghetti code’: the dreaded ‘Tag soup’. You won’t be able to make heads or tails of the logic. On the other hand, too much use of Response.Write means you will never be able to see the page at all until it renders. Use <%= %> when appropriate to get the best of both worlds.

    My first rule is to pay attention at the proportion of ‘variable text’ to ‘static text’.

    If you have just a few places with variable text to replace, the <%= %> syntax is very compact and readable. However, as the <%= %> start to accumulate, they obscure more and more of the HTML and at the same time the HTML obscures more and more of your logic. As a general rule, once you start taking about loops, you need to stop and switch to Response.Write`.

    There aren’t many other hard and fast rules. You need to decide for your particular page (or section of the page) which one is more important, or naturally harder to understand, or easier to break: your logic or your HTML? It’s usually one or the other (I’ve seen hundreds of cases of both)

    If you logic is more critical, you should weight more towards Response.Write; it will make the logic stand out. If you HTML is more critical, favor <%= %>, which will make the page structure more visible.

    Sometimes I’ve had to write both versions and compare them side-by-side to decide which one is more readable; it’s a last resort, but do it while the code is fresh in your mind and you will be glad three months later when you have to make changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started to use jquery and asp.net, bearing this in mind I was
Bearing in mind that I'll be performing calculations on lat / long pairs, what
I have the following (which I know is syntactically incorrect, maybe even bearing on
Isn't JavaScript enabled in all webbrowsers by default? if yes, does this mean that
Here's a noodle scratcher. Bearing in mind we have HTML5 local storage and xhr
I noticed this particular line of code when I was profiling my application (which
Is there any way, bearing in mind the way the jQuery Mobile framework operates,
I started objective-c and iOS a couple of weeks ago (worth bearing in mind),
i am using eclipse 3.5 to create a simple plugin bearing an extension point.
I'm beating my head against the wall pretty severely with this. I have several

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.