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]
 
Joined
Dec 6, 2011
Messages
1
Reaction score
0
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" %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top