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

Discussion in 'ASP .Net Web Controls' started by Masterx81, Dec 4, 2007.

  1. Masterx81

    Masterx81 Guest

    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!
    Masterx81, Dec 4, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Nipper

    Wizard control default button

    Ken Nipper, Dec 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,723
    Ken Nipper
    Dec 9, 2005
  2. Replies:
    0
    Views:
    572
  3. AlecL
    Replies:
    2
    Views:
    806
    Alexey Smirnov
    Feb 12, 2007
  4. Glenn
    Replies:
    0
    Views:
    378
    Glenn
    Mar 7, 2007
  5. Andy B
    Replies:
    0
    Views:
    420
    Andy B
    Apr 19, 2008
Loading...

Share This Page