LiteralControl thread safety.

  • Thread starter George Ter-Saakov
  • Start date
G

George Ter-Saakov

Hi.

I have template solution. The Base page creates the main skeleton for the
page.

For that it adds bunch of LiteralControls in run time.

I am thinking of creating those controls only once(during initialization)
and then just add them to control collection.

I realize that every instance of the page will use the same instance of the
LiteralControl but since they only have static text i think it will be OK
and will save me some CPU ticks.

Is it ok? Any problem with this approach?

Thanks.
George.
 
M

Martin Dechev

Hi, George,

It will be easier to answer your question if you post some code.

Basically, everything that is not static (in VB shared) or constant field
gets created for each instance of the class. With the inheritance you avoid
writing the same code many times, but the code gets executed anyway.

Greetings
Martin
 

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

Staff online

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top