Any performance hit when using inline code?

  • Thread starter Thread starter Showjumper
  • Start date Start date
S

Showjumper

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?
 
You don't pay a performance penalty for inline code since the runtime
will compile it.
 
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.
 
Back
Top