cyrus_ Posted March 17, 2006 Share Posted March 17, 2006 i want to change values of controls in a User Control when i click on a button in a another user control, but i get following error:Object reference not set to an instance of an objectCode://in My DownUserControl i callprotected void BTN_Click(object sender, EventArgs e){ TopUserControl TopUC = new TopUserControl(); TopUC.Title = "hello";}//and here I get the error in the TopUserControl:public string Title{ get { return TitleLable.Text } set { TitleLable.Text = value }} Link to comment Share on other sites More sharing options...
aspnetguy Posted March 17, 2006 Share Posted March 17, 2006 can you post the full erro and the full code.It is trying to process an object that is null or doesn't exist Link to comment Share on other sites More sharing options...
cyrus_ Posted March 17, 2006 Author Share Posted March 17, 2006 can you post the full erro and the full code.It is trying to process an object that is null or doesn't exist<{POST_SNAPBACK}> I am working with webparts 2.0,I have a aspx file that has a user control (uc1) in a WebPartZone in the uc1 i have another WebpartZone that contains another Ucer Control (uc2)my code is so long do you want to send it to you?thanks for your answer Link to comment Share on other sites More sharing options...
aspnetguy Posted March 17, 2006 Share Posted March 17, 2006 I have never used WEbparts...I probably couldn't help you then, sorry Link to comment Share on other sites More sharing options...
Jorsh Posted March 29, 2006 Share Posted March 29, 2006 I've also never used WebParts but is your control named "TitleLable" or is it "TitleLabel"? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now