2.0 ASP.NET Wizard Control

R

Rain

I have two buttons in the header template as I want to control the steps
from the top not the bottom. However, I cant seem to work out how to find
the controls within the wizard class.

Ive tried most things. Either it cant be got at or I havent tried it all (
most likely )

Thanks in advance.
 
H

Hillbilly

Enable Trace in the page and identify the control in the control tree
hierarchy. You will also observe how the control you want to reference is
nested in other templates; there are two ways to pass each template to the
FindControl method.

// 1st approach
Button myButton = Page.FindControl("object1$object2$MyButton") as Button;

// 2nd approach
Button myButton =
Page.FindControl("object1").FindControl("object2").FindControl("MyButton")
as Button;

I've discovered sometimes one approach works and the other doesn't and I
have no idea why but the 2nd approach is most common and produces results
most often.

Using FindControl is called Late Binding. You can also use Early Binding is
you learn to reference your object in the page using a Public Property which
you can learn about by going to Google School as Early Binding is more
efficient and allows referencing the object directly as if it were a static
object (as I think it is correct to say).
 
R

Rain

Thanks

Seems odd that u cant get to the controls in the header through the header
property of the wizard, but thats probably because I dont fully understand
how the wizard works.
 
H

Hillbilly

The Wizard is put together using the MultiView control. There is a DataList
control in the Sidebar. The Wizard control templates will take some time to
really learn well but will be worth the effort.
 
R

Rain

Thanks. In truth ive been coding .net for some time but never used the
wizard, ive been experimenting today with template and styling and you can
make it look pretty cool actually.

Thanks for all your help. Much appreciated.
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top