Default button on a web page with a wizard control...

M

Masterx81

Hi to all...
I'm developing my first app using asp.net 2.0, and i've a little
trouble.
This question probably was asked a million of time, but i haven't find
any working solution.
I have an aspx page with a table, on the upper/sx corner there is an
image with a logo (that cliking on it do a client script that open a
new window), on the upper/right corner there are few imagebuttons for
language selection, and in the center of the table there is a wizard
control with all it's sub controls (all label/calendar/checkbox and
textbox).

I want that when i press the enter key the 'next step' in the wizard
control will fire it's event.
As now, i've tryed ordinatig the tabindex property, and doing this
function at the loadcomplete:

If (wzdStep.ActiveStep.StepType = WizardStepType.Step) Then
ClientScript.RegisterHiddenField("__EVENTTARGET",
(Page.FindControl("wzdStep$StartNavigationTemplateContainerID
$StartNextButton")).UniqueID)
Page.Form.DefaultButton = (Page.FindControl("wzdStep
$StartNavigationTemplateContainerID$StartNextButton")).UniqueID
ElseIf (wzdStep.ActiveStep.StepType = WizardStepType.Start)
Then
ClientScript.RegisterHiddenField("__EVENTTARGET",
(Page.FindControl("Wzdstep$StepNavigationTemplateContainerID
$StepNextButton")).UniqueID)
Page.Form.DefaultButton = (Page.FindControl("Wzdstep
$StepNavigationTemplateContainerID$StepNextButton")).UniqueID
ElseIf (wzdStep.ActiveStep.StepType = WizardStepType.Finish)
Then
ClientScript.RegisterHiddenField("__EVENTTARGET",
(Page.FindControl("Wzdstep$FinishNavigationTemplateContainerID
$FinishButton")).UniqueID)
Page.Form.DefaultButton = (Page.FindControl("Wzdstep
$FinishNavigationTemplateContainerID$FinishButton")).UniqueID
End If

But the 'next step' button never is the default button, the control
that fire is the first control that the page render...

What is the solution?

Really thanks!
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top