Author: sumitravi | Posted on: 11/3/2009 11:01:27 AM | Views : 563

i have a cs file in app_code folder and an aspx page,,there is a text box defined in aspx page..i want to access the control of textbox in my cs file in app_code.i have tried this code


System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
TextBox txt = (TextBox)page.FindControl("TextBox2");


when i run my project,,it gives an error that object reference not set to an instance of an object 
...

Go to the complete details ...