I have a webform and in that webform, I am trying to access a Panel object from a static method, but couldn\'t access it How can I access a Panel object from static method.
public static void DoSomething() { if (HttpContext.Current != null) { Page page = (Page)HttpContext.Current.Handler; TextBox TextBox1 = (TextBox)page.FindControl("TextBox1"); TextBox TextBox2 = (TextBox)page.FindControl("TextBox2"); } }