Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

wizard ctrl within modalpopup: how to access the "finish" button? 1

Status
Not open for further replies.

NuJoizey

MIS
Aug 16, 2006
450
US
I have an asp.net wizard control which opens in a modal popup. It works nicely for the most part. User clicks a link, and the user can click thru wizard while the background is disabled.

However now I find I have the need to disable the Finish button on the last page of the wizard upon a certain event, but it seems not to be accessible. I can't believe it isn't accessible at all, there MUST be a way, right? So far, everything I try throws a javascript error "Object Reference not set to an instance of an object". If I hit view>source, I can't seem to find the control rendered anywhere.

in my wizard aspx, i have templates defined like so:
Code:
<FinishNavigationTemplate>                           
   <asp:Button ID="btnPrevWiz4" runat="server" Text="PreviousX" >
  <asp:Button ID="btnFinishWiz4" runat="server" Text="FinishX" />
  <asp:Button ID="btnCancelWiz4" runat="server" Text="CancelX" />
</FinishNavigationTemplate>

vb code that i tried which doesn't find the control looks like:
Code:
'This doesn't work:
'Dim btnFinishWiz4 As Button = Me.wizNewPlacementStep4.FindControl("btnFinishWiz4")

'..and neither does this
Dim btnFinishWiz4 As Button = Me.panNewPlacement2.FindControl("updNewPlacement").FindControl("wizNewPlacement").FindControl("btnFinishWiz4")

'this is what i'm trying to do:  disble the button when certain circumstances exist:
btnFinishWiz4.Enabled = False

Need help! This is a showstopper for me! I think it may have something to do with the fact that the wizard lives on a modalpopupextender control, (am i right?) but danged if I can find how to access it to do what I want!!!!
 
I pretty sure it has nothing to do with the modal. as a test spike a quick webpage with a simple 2 step wizard. then find the finish button.

You may have to find the finish template, and then find the finish button within the template.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Thanks Jason. You are most trusty. I don't think I could do my job without you.....but maybe someday...... <ha ha>

Anyway, your post was very helpful to me in that it bolstered my resolve to keep searching for the answer, which seems to be:

Code:
Dim btnFinishWiz4 As Button = Me.wizNewPlacement.FindControl("FinishNavigationTemplateContainerID$btnFinishWiz4")

which I found in this post:


..and like one of the posters commented, I don't know where the heck I would have ever found it myself.......
 
glad to help... how if we could only pull you away from webforms altogether :)

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
they are kind of a pain, and seem to require a lot of coding and esoteric syntaxes. To me there are a lot of things that aren't intuitive, or easy to find out. I waste a lot of time saying to myself "i know there must be a way to do this......but how....."

Are you referring to developing using MVC or something like that?
 
exactly :) mvc with a sensible html engine is great. I use Monorail with aspview (closest to c#) I want to find time to tool around with Spark. that is a wickedly slick html engine.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
now that i've been doing Micro$oft development work full on for over two years now, i think i am starting to see the light a little bit. i will have to check more into this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top