Using FIndControl causing error System.NullReferenceException

Joined
Jan 8, 2008
Messages
1
Reaction score
0
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
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top