The reason is that when ASP.NET adds the navigation area controls to the wizard control, it adds a prefix onto the control name.
To find the control, add the appropriate prefix to the control name:
If your control is in... | Use... |
---|---|
StartNavigationTemplate | StartNavigationTemplateContainerID$ |
StepNavigationTemplate | StepNavigationTemplateContainerID$ |
FinishNavigationTemplate | FinishNavigationTemplateContainerID$ |
For example, if you want to find a button named "FinishButton" in the finish navigation step, you'd use a line of code like this...
Button finishButton = Wizard1.FindControl("FinishNavigationTemplateContainerID$FinishButton") as Button;
At this point, you'll be able to use all of the normal properties of the button, like this snippet to disable the finish button after it has been clicked:
string script = String.Format("window.setTimeout(function(){{{0}.disabled = true;}},10);", finishButton.ClientID);
finishButton.OnClientClick = script;
5 comments:
Very useful, thanks for sharing!
After some days trying to find a solution do hide the finish button in a wizard control, I've found it here. Thank you.
Awesome Man, Thanx a lot
Exactly what I was looking for! Thank for saving me time trying to figure this out.
Awesome Man .. Thanks Alot ..
Post a Comment