Dinesh Santhalingam

Dinesh Santhalingam

  • NA
  • 737
  • 367.5k

Access the asp page controllers inside a static method

Jan 3 2017 2:37 AM
I have a Webpage having some controls like Text box, Buttons ,etc.,
 
  1. Asp:  
  2. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>   
  3. <asp:TextBox ID="TextBox2" runat="server" ReadOnly = "false"></asp:TextBox>   
  4. <asp:TextBox ID="TextBox1" runat="server" ReadOnly = "false"></asp:TextBox>  
  5. <asp:button runat="server" id="loadbtn" Text="Load" />  
  6.    
  7. C#:  
  8. public static Array Load()  
  9. {  
  10.  string a=textbox1.text.Tostring();  
  11.  // I Can't access the controls inside a static method.  
  12. }   
 Please suggest some ideas .,

Answers (9)