Referencing controls inside Wizard control

J

James Bond

Hi all,

I am having trouble referencing (directly) the controls (web) inside the
wizard control.

I have a templated Header control wherein I have a asp:Label. Eventhough
the IDE shows the control in Server Objects, I am unable to reference in my
code directly.
 
B

Brock Allen

Use:

TextBox textBox1 = WizardStep1.CustomNavigationTemplateContainer.FindControl("TextBox1")
as TextBox;
 
B

Brock Allen

Unfortunately that doesn't work, Clinton, because of the template nature
of the wizard. It's necessary to go to the template container for whichever
step they need to get at:

For the content part it's:
_WizStep1.ContentTemplateContainer.FindControl

For the custom navigation part it's:
_WizStep1.CustomNavigationTemplateContainer.FindControl
 
C

clintonG

Of course, thank you for bringing this to our attention Brock.
I forgot the correct grammar even though I had to use "template containers"
in my grammar when learning to reference controls in the MasterPage.

Basically, as I am beginning to understand the 2.0 control tree, every
nested element of an HTML template becomes a control in the control tree
hierarchy. When referencing a "standard" control which may be located within
a template container -- a label or textbox for example -- we must use dotted
notation and a grammatical reference to each "template container" to
recreate the control tree hierarchy linearly. It would be great if we had a
"term" to refer to this grammatical process.

And if I'm not mistaken I don't think your reminder to use correct grammar
obviates the need for a cast. That would be correct ainna?

What I would like to master is when to decide to use public properties for
early bound references as I have this assumption that the use of public
properties allows standard controls which may be located within a template
container to be referenced directly.

This will be important for my own first use of the Wizard control which I am
just today finishing the HTML for and will need to access controls such as
CheckBoxList controls and so on. If public properties would make this
cleaner, more efficient and easier to code I'm all ears.

<%= Clinton Gallagher
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top