S
STech
I would like multiple instances of a custom webcontrol that I am writing to
be able to share some common inline html. ie. if the first custom control on
the page has rendered this html, the remaining instances of this custom
control should not render it.
This would be similar to the RegisterClientScriptBlock where one can check
Page.IsClientScriptBlockRegistered so that other controls do not render the
same script block again.
My question is can I use the RegisterClientScriptBlock to render this common
inline html code and use the same Page.IsClientScriptBlockRegistered to
check if the common inline html has been rendered or not.
The other approach would be to store a boolean in the context which
indicates whether the html common code has been rendered and have other
controls check this context object.
Would you recommend any of these methods or is there a better method. Will
ASP.Net 2.0 break anything?
Thanks!
be able to share some common inline html. ie. if the first custom control on
the page has rendered this html, the remaining instances of this custom
control should not render it.
This would be similar to the RegisterClientScriptBlock where one can check
Page.IsClientScriptBlockRegistered so that other controls do not render the
same script block again.
My question is can I use the RegisterClientScriptBlock to render this common
inline html code and use the same Page.IsClientScriptBlockRegistered to
check if the common inline html has been rendered or not.
The other approach would be to store a boolean in the context which
indicates whether the html common code has been rendered and have other
controls check this context object.
Would you recommend any of these methods or is there a better method. Will
ASP.Net 2.0 break anything?
Thanks!