asp.net - Part of custom control should be rendered only once -


i working on custom control. part of render div not displayed right away. based on particular client event, div shown. works fine when there once instance of custom control on page. in case of multiple instances, many above mentioned divs rendered, though not displayed. make container page lighter, want render div once, irrespective of number of occurrences of custom control. great.

thanks, surya

perhaps can store flag telling that div has been rendered. can store flag in httpcontext.items. here code

if ((bool)httpcontext.current.items["divrendered"] == false) {    //render div    httpcontext.current.items["divrendered"] = true; } 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -