Which is better Response.Write ..or

Results 1 to 6 of 6

Thread: Which is better Response.Write ..or

  1. #1
    bart_bart Guest

    Default Which is better Response.Write ..or

    Hi-<BR> I just had a quick question regarding the pros and cons of using a Response.write instead of closing the asp tag and writing straight html.<BR><BR>Is it more efficient to use Response.Write whenever possible? It It makes for longer coding but makes for more consistent/readable code.<BR><BR>Thanks for your input!!!<BR><BR>Bart N. <BR>

  2. #2
    Paul Merton Guest

    Default RE: Which is better Response.Write ..or

    I would imagine that the scripting engine runs more quickly over code that does not use Response.Write.<BR><BR>I.e.<BR> ...code...%&#062;somehtml&#060;%...code...<BR>is more efficient than<BR> ...code...<BR> Response.Write("somehtml")<BR> ...code...<BR><BR>Also, if you use Response.Write, you also then have the hassle about espaping certain characters than appear in in, such as ".<BR><BR>I would also strongly argue that you are wrong about Response.Write making for more readable code.<BR><BR>Hope that helps!<BR>paul_merton@hotmail.com

  3. #3
    seshat Guest

    Default RE: Which is better Response.Write ..or

    Bart--<BR><BR>Despite what the other guy says, I think Response.Write is more practical. You end up using fewer lines of code overall. <BR><BR>AND you can use Response.Write with if...then statements to test various portions of your script without closing out (and later reopening) your VBScript tags to mess with HTML. <BR><BR>Listen, as far as I&#039m concerned, the fewer "&#060;"s and "&#062;"s I have to type, the better!<BR><BR>Have a great afternoon!<BR><BR>Sesh

  4. #4
    Gary Van Sluis Guest

    Default RE: Which is better Response.Write ..or

    Using Response.write is faster.<BR>What happens when you run into code &#060;%%&#062; is that code has to be sent to the asp interpreter. Then the closing tag is found it then returns to parse out HTML, then it encounter more &#060;% %&#062; tags and has to return back to the intrepter. <BR>If you stick response.write ("<BR>html tags here..etc")..you save the server from having to start and stop the asp interpeter. Now...this may be such a small difference that you would not notice...on the other hand me and 6 developers just had to redo a HUGE site looking for ANY way to improve speed and that was one way to do it.<BR><BR>Hope that helps.<BR>Gary<BR>

  5. #5
    sean Guest

    Default RE: Which is better Response.Write ..or


  6. #6
    bart_bart Guest

    Default RE: Thx... Speed Diff noticeable

    Thanks for the response to my question. I&#039ve been testing scripts with and without the Response.Write and timing them on the servers. There is a noticeable margin of speed difference between the two!<BR><BR>Bart N<BR>

Posting Permissions

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