C# Web User Controls

Sep 29 2004 7:37 PM
Hi, I am not able to make this work. Here is the error: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 154: UserControl objCtrl = ((UserControl)(FindControl("System.Web.UI.WebControls.DropDownList _drlStockStatus"))); Line 155: DropDownList ddl = ((DropDownList)(objCtrl.FindControl("_drlStockStatus"))); // -->Breaks here<-- Line 156: Response.Write(ddl.SelectedItem.Value); I have also tried this: String item = ((DropDownList)_pnl_lb.FindControl("_drlStockStatus")).SelectedItem.Text;