Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

asp.net wizard?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 24 Aug 2007 13:22 GMT
I'm helping out on a web app and the developer that created the aspx pages is using <asp:wizard> on the form. There are dropdowns, labels, buttons, etc within each wizard.

How can I find a button in one of these wizards? I'm using something like

Button btn = (Button)Wizard.WizardStep[4].FindControl("button1");
btn.visible = false;

but  I keep getting the error:
'Error: Object reference not set to an instance of an object'

how can find the button in the wizard so I can hide it?
Rob Meade - 24 Aug 2007 13:52 GMT
> how can find the button in the wizard so I can hide it?

If you run your app in debug mode can you stick a break point on the
page_load or event handler for that button, and then travese the properties
of the page/sender etc to see exactly what its called?  The info contained
here might help you with the FindControl method.

HTH

Regards

Rob
Mike - 24 Aug 2007 14:02 GMT
i did that, I ran the page and did view source and got the actual control
name, and plugged that in the FindControl() and I still got the same error
message.

>> how can find the button in the wizard so I can hide it?
>
[quoted text clipped - 8 lines]
>
> Rob
clintonG - 26 Aug 2007 02:02 GMT
Enable trace in the page. You will be able to identify your button1 control
by reading through the control hierarchy. We must reuse the object name
hierarchy with the FindControl method. The use of the FindControl method
becomes somewhat convoluted when using MasterPages as you will often need to
use repetitive instances of the FindControl method in the same statement
which you will use to instantiate a btn object.

Signature

<%= Clinton Gallagher
        NET csgallagher AT metromilwaukee.com
        URL http://clintongallagher.metromilwaukee.com/

I'm helping out on a web app and the developer that created the aspx pages
is using <asp:wizard> on the form. There are dropdowns, labels, buttons, etc
within each wizard.

How can I find a button in one of these wizards? I'm using something like

Button btn = (Button)Wizard.WizardStep[4].FindControl("button1");
btn.visible = false;

but  I keep getting the error:
'Error: Object reference not set to an instance of an object'

how can find the button in the wizard so I can hide it?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.