1

I have this piece of code:- What I want is that in button click i want put some value in user control. I get Object reference error.

if (Page.FindControl("pr1") is Control)
{
    Control previewControl = Page.FindControl("pr1");
    Label titleLabelPreview = (Label)previewControl.FindControl("titleLabel");
    titleLabelPreview.Text = emptxt.Text;

However, if i used it through master page it can not intialized but if i use parent page it work properly. But here, one more problem persisted, suppose the scenario use a tab container where is 3 tab panel in first panel i used a button when i click that button i want to change the tab panel view means 2nd panel but without refresh the page. and one important thing i don't want to use update panel on tab container. I do not wish to use ajax or javascript. any insight on this. Also, would be really great if someone gives me a deep idea how to resolve object reference errors. I read a few blogs like:_

http://www.mikesdotnetting.com/Article/62/Object-reference-not-set-to-an-instance-of-an-object-and-INamingContainer

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.passwordrecovery.usernametemplate.aspx

however, was not fully satisfied.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
jinx
  • 95
  • 1
  • 1
  • 5
  • Please see http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts – John Saunders Sep 28 '11 at 13:53
  • Thanks John, I'll keep that in mind, could you please help me with the problem. – jinx Oct 01 '11 at 18:35
  • Your question is very confused. I don't think anyone will be able to answer it until you get a better idea of what you're doing. The fact that you don't even seem to understand your "object reference error" is scary. See http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-in-net – John Saunders Oct 01 '11 at 20:16

0 Answers0