We use Page.ParseControl
to interpret a string of XML into controls. Does it use some kind of caching mechanism? If not - is there a way to cache its result?
Page.LoadControl
seems to support some sort of caching.
We use Page.ParseControl
to interpret a string of XML into controls. Does it use some kind of caching mechanism? If not - is there a way to cache its result?
Page.LoadControl
seems to support some sort of caching.
There does not seem to be any caching involved.
As a Control
is a reference types, caching wouldn't be recommended in this case. (You want a new instance of the control each time you call the ParseControl
function)
LoadControl
doesn't perform caching per say, but the difference is rather that ParseControl
will parse the input string every time to create the control dynamically, while LoadControl
will re-use the parsed control template and class type when creating new instances, making it an order of magnitude faster.