ATTN: ALL ASP GURUS

Results 1 to 9 of 9

Thread: ATTN: ALL ASP GURUS

  1. #1
    Brad Foust Guest

    Default ATTN: ALL ASP GURUS

    I would like some feedback on the following topic. Which is quicker/more efficient code number 1 or number 2?<BR><BR>1) &#060;% do while not rs.eof &#037;&#062;<BR> &#060;tr><BR> &#060;td>this is the HTML/ASP version&#060;/td><BR> &#060;/tr><BR> &#060;% rs.moveNext &#037;&#062;<BR> &#060;% loop &#037;&#062;<BR><BR>2) &#060;%<BR> do while not rs.eof <BR> response.write "&#060;tr>"<BR> response.write "&#060;td>this is the ASP version&#060;/td>"<BR> response.write "&#060;/tr>"<BR> rs.moveNext <BR> loop<BR> &#037;&#062;<BR><BR>Basicly, does it slow the code down when you mix ASP/HTML together? Does anyone know of any good articles on this? What do you think?<BR><BR>

  2. #2
    Brad Foust Guest

    Default RE: ATTN: ALL ASP GURUS

    Just pretend that there is a recordset between the &#060;td>&#060;/td> in both! OOPS :)

  3. #3
    Stephen Fisher Guest

    Default RE: ATTN: ALL ASP GURUS

    What I heard was the best was something like<BR><BR>2) &#060;%<BR>do while not rs.eof <BR>strOutput = strOutput & "&#060;tr>"<BR>strOutput = strOutput & "&#060;td>this is the ASP version&#060;/td>"<BR>strOutput = strOutput & "&#060;/tr>"<BR>rs.moveNext <BR>loop<BR>response.write strOutput.<BR>&#037;&#062;<BR><BR>This only a rumor but it makes sense to me.

  4. #4
    Brad Foust Guest

    Default RE: ATTN: ALL ASP GURUS

    Very interesting. Does anyone know of any official documentation from MicroSoft that says anything on this?


  5. #5
    Sam Otto Guest

    Default RE: ATTN: ALL ASP GURUS

    I&#039d love to know the answer to both of these:<BR>1) I&#039ve read its bad to intermix HTML and VBScript a lot but when your replacing the HTML with VB Functions calls (Response.write&#039s), it can&#039t be faster, right?<BR>2) Is it better to call Response.write 10 times or keep concatenating up a string and then call Response.write once?<BR><BR>I&#039ll sure be following this thread!!!

  6. #6
    Ian Hoppes Guest

    Default RE: ATTN: ALL ASP GURUS

    from what im thinking, the intermixing of asp/html would be better instead of the response.write solutions. any response.write is done at the server, whereas any included html is processed at the client by the browser, thus less server load. just a thought...feel free to correct me.<BR><BR>ian hoppes<BR>ian@shelby.net

  7. #7
    Mike Harris Guest

    Default RE: ATTN: ALL ASP GURUS

    I agree. I use the HTML and ASP combo. I have heard of developers that use response.write for everything. It seems like that would be the slow way. I don&#039t know for sure.

  8. #8
    Stephen Fisher Guest

    Default RE: ATTN: ALL ASP GURUS

    Of all the three options above what is sent to the client is the same. <BR><BR>This is not a client vs server arguement. <BR><BR>The point is how does asp switch between script and tags. <BR><BR>When you do a &#060;%=myVar&#037;&#062; to write out HTML this is a response.write. Rather than process lots of response.writes, it makes perfect sense to me to write only one response.write once the string is built.

  9. #9
    kook Guest

    Default RE: ATTN: ALL ASP GURUS

    90% of html executes at browser level <BR>and asp script eceute at server level<BR>so using directly html is faster

Posting Permissions

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