asp.net C# header

Joined
Nov 3, 2011
Messages
1
Reaction score
0
I am having the following problem. I cannot find a control in the header (ascx page)


I am using this code.

Any help would be appreciated.

____________________________________

Object reference not set to an instance of an object. [FONT=Arial, Helvetica, Geneva, SunSans-Regular, sans-serif] 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 92: //TextBox3.Text = s.ToString();Line 93: }Line 94: TextBox TextBox3 = (TextBox)FindControl("headerGreen").FindControl("TextBox3");[/FONT]
 
have you actually registered your UserControl (.ascx) on your webpage?

You need to use something like this:


<%
@ Register TagPrefix="UserControl" TagName="whateverName" Src="~/UserControl/yourUserControl.ascx" %>
 
Back
Top