A
Andy B
I have 2 TextBoxes and a Label inside the EditItemTemplate of a formView
(the EditItemTemplate is the only template it has). I need to access the
properties of the Label and TextBox controls elsewhere on the page. How do
you do something like that? I tried probably just about everything I can
think of. I tried this line of code but I keep getting a null reference
exception.
Label DateConfirmLabel =
(Label)EditNewsForm.Controls[0].FindControl("DateLabel");
The really strange thing, this worked when I needed my Menu from the
masterPage:
Menu MainMenu = (Menu)this.Master.FindControl("MainMenu");
Then I could access the MenuItems normally. Help!
The FormView is inside a wizard.
(the EditItemTemplate is the only template it has). I need to access the
properties of the Label and TextBox controls elsewhere on the page. How do
you do something like that? I tried probably just about everything I can
think of. I tried this line of code but I keep getting a null reference
exception.
Label DateConfirmLabel =
(Label)EditNewsForm.Controls[0].FindControl("DateLabel");
The really strange thing, this worked when I needed my Menu from the
masterPage:
Menu MainMenu = (Menu)this.Master.FindControl("MainMenu");
Then I could access the MenuItems normally. Help!
The FormView is inside a wizard.