Any performance hit when using inline code?

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?
 
S

Scott Allen

You don't pay a performance penalty for inline code since the runtime
will compile it.
 
K

Kevin Spencer

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.
 

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
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top