Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Using FIndControl causing error System.NullReferenceException

Reply
Thread Tools

Using FIndControl causing error System.NullReferenceException

 
 
EmmaKate EmmaKate is offline
Junior Member
Join Date: Jan 2008
Posts: 1
 
      01-08-2008
Hi,

Having a problem with my FindControl. Want to change the Label value from another aspx page. (Using C#).Heres the code

Label HomeLabel = (Label)Page.FindControl("HomeLabel");

HomeLabel.Text = TextBox1.Text;

This is what is causing the error System.NullReferenceException.

Thanks in Advance
Emma
 
Reply With Quote
 
 
 
Reply

Thread Tools

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
FormView FindControl error David C ASP .Net 1 10-28-2009 10:27 PM
Templated Controls FindControl() error David Rees ASP .Net 0 07-15-2006 11:07 PM
Error Message: FindControl requires that controls have unique IDs. Elton W ASP .Net Datagrid Control 0 04-21-2005 08:35 PM
Using FindControl() in global code base =?Utf-8?B?RCBTaGVsZG9u?= ASP .Net 6 05-10-2004 12:51 PM
error on findcontrol(MyPanel,panel) Peter Kaufman ASP .Net Web Controls 0 01-24-2004 11:46 AM



Advertisments