Using FIndControl causing error System.NullReferenceException

Discussion in '.NET' started by EmmaKate, Jan 8, 2008.

  1. EmmaKate

    EmmaKate

    Joined:
    Jan 8, 2008
    Messages:
    1
    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
    EmmaKate, Jan 8, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manny
    Replies:
    1
    Views:
    439
    Lau Lei Cheong
    Aug 2, 2004
  2. William F. Robertson, Jr.

    ListBox.Items.Clear() causing System.NullReferenceException...

    William F. Robertson, Jr., Sep 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,854
    William F. Robertson, Jr.
    Sep 15, 2004
  3. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    Whats the error:- System.NullReferenceException:

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 31, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    4,597
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Nov 1, 2004
  4. razilon@hotmail.com
    Replies:
    1
    Views:
    326
    Jonathan Mcdougall
    May 24, 2006
  5. Ruchi22
    Replies:
    0
    Views:
    916
    Ruchi22
    Sep 23, 2011
Loading...

Share This Page