PC Review


Reply
Thread Tools Rate Thread

asp.net C# header

 
 
New Member
Join Date: Nov 2011
Posts: 1
 
      3rd Nov 2011
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. 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");
 
Reply With Quote
 
 
 
 
Banned
Join Date: Dec 2011
Posts: 1
 
      6th Dec 2011
have you actually registered your UserControl (.ascx) on your webpage?

You need to use something like this:


<%
@RegisterTagPrefix="UserControl"TagName="whateverName"Src="~/UserControl/yourUserControl.ascx" %>
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 AM.