Skip to content
Loading
Access the asp page controllers inside a static method
  • Mangesh G
    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"); } } Probably you can try like this but My suggestion is to go for the jquery I tried the same thing day before was unable to do.so I opted the jquery after that Mark approved if it helps