Ask a Question related to ASP, Design and Development.
-
Stefan Berglund #1
Is it inefficient to intermix HTML and script?
I've noticed that most examples offered in this group tend to use Response.Write to spit out the HTML rather than switch between
script and HTML. I also came across an article intimating the same idea. Is this considered inefficient?
<%If (IsArray(ar)) Then
Const cNumber = 0
Const cHorse = 1
Const cOwner = 2
Const cTrainer = 3
Const cRider = 4
Const cHorseID = 5
Const cOwnerID = 6
Const cTrainerID = 7
Const cRiderID = 8%>
<tr>
<th width="8%" align="center"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Number"><font face="Arial, Helvetica, sans-serif" size="2"><b>Number</b></font></a></th>
<th width="23%" align="left"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Horse"><font face="Arial, Helvetica, sans-serif" size="2"><b>Horse</b></font></a></th>
<th width="23%" align="left"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Owner"><font face="Arial, Helvetica, sans-serif" size="2"><b>Owner</b></font></a></th>
<th width="23%" align="left"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Trainer"><font face="Arial, Helvetica, sans-serif" size="2"><b>Trainer</b></font></a></th>
<th width="23%" align="left"><a class="results" href="showshowentries.asp?Show=<%= strShowID%>&Sort=Rider"><font face="Arial, Helvetica, sans-serif"
size="2"><b>Rider</b></font></a></th></tr>
<% Dim iRow
For iRow = 0 To UBound(ar,2)%>
<tr>
<td width="8%" align="center" valign="top"><font face="Arial, Helvetica, sans-serif" size="2"><%= ar(cNumber,iRow)%></font></td>
<td width="23%" align="left" valign="top"><a class="results" href="showexhibitorresults.asp?Show=<%= strShowID%>&HorseID=<%= ar(cHorseID,iRow)%>"><font face="Arial, Helvetica, sans-serif"
size="2"><%= ar(cHorse,iRow)%></font></a></td>
<td width="23%" align="left" valign="top"><a class="results" href="showexhibitorresults.asp?Show=<%= strShowID%>&OwnerID=<%= ar(cOwnerID,iRow)%>"><font face="Arial, Helvetica, sans-serif"
size="2"><%= ar(cOwner,iRow)%></font></a></td>
<td width="23%" align="left" valign="top"><a class="results" href="showexhibitorresults.asp?Show=<%= strShowID%>&TrainerID=<%= ar(cTrainerID,iRow)%>"><font face="Arial, Helvetica,
sans-serif" size="2"><%= ar(cTrainer,iRow)%></font></a></td>
<td width="23%" align="left" valign="top"><a class="results" href="showexhibitorresults.asp?Show=<%= strShowID%>&RiderID=<%= ar(cRiderID,iRow)%>"><font face="Arial, Helvetica, sans-serif"
size="2"><%= ar(cRider,iRow)%></font></a></td></tr>
<% Next%>
<tr>
<td align="right" colspan="5"><font face="Arial, Helvetica, sans-serif" size="2"><b><%= intTotalEntries%> total show entries </b></font></td></tr>
<%Else%>
<tr>
<td colspan="5" align="center"><font face="Arial, Helvetica, sans-serif" size="2"><b>There are no items to show in this view.</b></font></td></tr>
<%End If%>
</table>
</td>
</tr>
<!--#include file="inc/table_end.asp" -->
Stefan Berglund Guest
-
#37168 [Fbk->Opn]: WDDX serializer inefficient with larger structures
ID: 37168 User updated by: dolecek at sky dot cz Reported By: dolecek at sky dot cz -Status: Feedback +Status: ... -
#37168 [Opn->Fbk]: WDDX serializer inefficient with larger structures
ID: 37168 Updated by: iliaa@php.net Reported By: dolecek at sky dot cz -Status: Open +Status: ... -
Using a script to have CF convert cfm to html
I have a page that takes the coldfusion server a long time to process and its contents are the same for everyone. I want to write a script that will... -
Array slicing through a reference: Inefficient?
Dear Group-- I'm working on a project where I'm working with large arrays, and I'm using references to pass arrays around to reduce memory use as... -
Is this inefficient?
I may have two buttons on the form and the Form Action has the same value as the current form, then at the top of my php script, I may have ... -
Aaron Bertrand - MVP #2
Re: Is it inefficient to intermix HTML and script?
> I've noticed that most examples offered in this group tend to use
Response.Write to spit out the HTML rather than switch betweenIs this considered inefficient?> script and HTML. I also came across an article intimating the same idea.
No, just much more difficult to read / maintain, IMHO. I prefer
response.write, but there really is no difference in performance due to
context switches between ASP and HTML (though at one point the ASP parser
wasn't as smart as it is now, and you would notice a hit given enough
volume).
Aaron Bertrand - MVP Guest
-
Ray at #3
Re: Is it inefficient to intermix HTML and script?
If you're running IIS 5 or higher, don't worry about it. Do whichever you
are more comfortable with. If you're on IIS 4 (NT), yeah, it's inefficient,
but hopefully you won't be on an NT server for much longer, so I wouldn't
worry about it. Just code comfortably. :]
Ray at work
"Stefan Berglund" <keepit@in.thegroups> wrote in message
news:v9g8pv0q18k9n199dobahhcga06f04rpt1@4ax.com...Response.Write to spit out the HTML rather than switch between> I've noticed that most examples offered in this group tend to useIs this considered inefficient?> script and HTML. I also came across an article intimating the same idea.
Ray at Guest
-
Jeff Cochran #4
Re: Is it inefficient to intermix HTML and script?
On Mon, 20 Oct 2003 13:17:02 -0700, Stefan Berglund
<keepit@in.thegroups> wrote:
For me it's force of habit and the method of coding. I tend to write>I've noticed that most examples offered in this group tend to use Response.Write to spit out the HTML rather than switch between
>script and HTML. I also came across an article intimating the same idea. Is this considered inefficient?
ASP in commented pseudocode to get the process down, then fill in the
bits and pieces testing as I go. Since I tend to do a lot of
Response.Write statements to show the output and values as I code,
when I get to the HTML I tend to leave the Response.Write alone and
fit in the HTML code into the Response.Write statements.
On the other hand, when I'm editing/maintaining someone else's code
that has the HTML separated and does things like:
<P>Glad to see you here on <% =(Now) %></P>
Then I tend to work in the same manner the original code is written.
Note that I am by far a sloppy coder, generally poorly organized and
bad at useful documentation, plus I tend to leave irrelevant code in
at times, but hey, it works. :)
Jeff
Jeff Cochran Guest
-
Stefan Berglund #5
Re: Is it inefficient to intermix HTML and script?
On Mon, 20 Oct 2003 13:17:02 -0700, Stefan Berglund
<keepit@in.thegroups> wrote:
in <v9g8pv0q18k9n199dobahhcga06f04rpt1@4ax.com>
Thank you gentlemen one and all for your valued consideration and>I've noticed that most examples offered in this group tend to use Response.Write to spit out the HTML rather than switch between
>script and HTML. I also came across an article intimating the same idea. Is this considered inefficient?
comments.
Stefan Berglund Guest



Reply With Quote

