Add 'Current' property to ASP.NET control

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-05-14T09:15:45Z Indexed on 2010/05/14 9:44 UTC
Read the original article Hit count: 186

Filed under:
|

Hi! I have some control. I add one instance of this control to every Page in OnInit event and I want to access this control in other places in this way: Sample.Current

public class Sample : Control
{
    public static Sample Current
    {
        get
        {
            // ???
        }
    }
}

Can you tell me what is the best way to do this property implementation?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about custom-controls