LiteralControl thread safety.

  • Thread starter Thread starter George Ter-Saakov
  • Start date 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.
 
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
 
Back
Top