Server control vs. <%= %> block to display text ??

  • Thread starter Thread starter Marlon
  • Start date Start date
M

Marlon

Which one of the methods would use less server resources and give better
performance to display data on a page?
 
Marlon:
<%= %> will give more performance..but considering how much more of a PITA
it will be to maintain, you'll be able to afford better hardware if you use
Server controls.

In other words, the 1 nanosecond you'll gain by using <%= %> makes the
question trivial...it shouldn't be about performance but about
maintainability (read development time, likelyhood of bugs, ...)

Karl
 
....And, by including server side script tags, you are going to lose that
nice separation of code vs. content.
 
Thanks for Scott and Karl's suggestions.

Hi Marlon,

In addition to the the code maintenance and separation code and content, if
the page where you are to use
<% %> is just for displaying( no much interactive functions), I think <% %>
will be ok since it just output html content into the response stream and
will cause no overhead to the page's ViewState( no like most server
controls which may store much data in the page's Viewstate) which cause the
page's size increased.
Anyway, the server control and controls based page structure is a wonderful
feature makes the web developing much easier and powerful. So using server
controls will always be recommended if you haven't any critical concerns on
performance. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top