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

M

Marlon

Which one of the methods would use less server resources and give better
performance to display data on a page?
 
K

Karl Seguin

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
 
S

Scott M.

....And, by including server side script tags, you are going to lose that
nice separation of code vs. content.
 
S

Steven Cheng[MSFT]

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top