By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,350 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,350 IT Pros & Developers. It's quick & easy.

Any performance hit when using inline code?

P: n/a
Is there a peformance hit when using inline code? As an example, lets i
store a user's preferences for backgtound color of a page. When he/she logs
in, i stick the color value into their session and then pull it out on the
next page and populate the bgcolor of the body directly in the html. Does
this approach have any loss in performance as compared to adding
runat=server to the body tag and accessing it from code behind? If there is
a loss in performance, can it add up with a number of users?
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You don't pay a performance penalty for inline code since the runtime
will compile it.

--
Scott
http://www.OdeToCode.com

On Thu, 29 Jan 2004 19:01:23 -0600, "Showjumper"
<sh*******@grkjashdjkf.com> wrote:
Is there a peformance hit when using inline code? As an example, lets i
store a user's preferences for backgtound color of a page. When he/she logs
in, i stick the color value into their session and then pull it out on the
next page and populate the bgcolor of the body directly in the html. Does
this approach have any loss in performance as compared to adding
runat=server to the body tag and accessing it from code behind? If there is
a loss in performance, can it add up with a number of users?


Nov 18 '05 #2

P: n/a
There may be a slight performance differenc ewith regards to the initial
compilation if you don't use a DLL for the CodeBehind. However, as Pages are
cached after compilation, the difference would be minimal.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Showjumper" <sh*******@grkjashdjkf.com> wrote in message
news:#1**************@TK2MSFTNGP10.phx.gbl...
Is there a peformance hit when using inline code? As an example, lets i
store a user's preferences for backgtound color of a page. When he/she logs in, i stick the color value into their session and then pull it out on the
next page and populate the bgcolor of the body directly in the html. Does
this approach have any loss in performance as compared to adding
runat=server to the body tag and accessing it from code behind? If there is a loss in performance, can it add up with a number of users?

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.