當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET Wizard類代碼示例

本文整理匯總了VB.NET中System.Web.UI.WebControls.Wizard的典型用法代碼示例。如果您正苦於以下問題:VB.NET Wizard類的具體用法?VB.NET Wizard怎麽用?VB.NET Wizard使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Wizard類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。

示例1: OnFinishButtonClick

Partial Class WizardClassvb_aspx
    Inherits System.Web.UI.Page

   Protected Sub OnFinishButtonClick(ByVal sender As Object, ByVal e As WizardNavigationEventArgs) Handles Wizard1.FinishButtonClick

        ' The OnFinishButtonClick method is a good place to collect all
        ' the data from the completed pages and persist it to the data store. 

        ' For this example, write a confirmation message to the Complete page
        ' of the Wizard control.
        Dim tempLabel As Label = CType(Wizard1.FindControl("CompleteMessageLabel"), Label)
        If Not tempLabel Is Nothing Then

            Dim tempEmailAddress As String = "your email address"
            If EmailAddress.Text.Length <> 0 Then
                tempEmailAddress = EmailAddress.Text
            End If

            tempLabel.Text = "Your order has been placed. An email confirmation will be sent to " & _
                tempEmailAddress & "."

        End If
    End Sub

    Protected Sub OnGoBackButtonClick(ByVal sender As Object, ByVal e As EventArgs) Handles GoBackButton.Click

        ' The GoBackButtonClick event is raised when the GoBackButton
        ' is clicked on the Finish page of the Wizard.  

        ' Check the value of Step1's AllowReturn property.
        If Step1.AllowReturn Then
            ' Return to Step1.
            Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.Step1)
        Else
            ' Step1 is not a valid step to return to; go to Step2 instead.
            Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.Step2)
            Response.Write("ActiveStep is set to Step2 because Step1 has AllowReturn set to false.")
        End If
    End Sub

    Protected Sub OnActiveStepChanged(ByVal sender As Object, ByVal e As EventArgs) Handles Wizard1.ActiveStepChanged

        ' If the ActiveStep is changing to Step3, check to see whether the 
        ' SeparateShippingCheckBox is selected.  If it is not, skip to the
        ' Finish step.

        If (Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.Step3)) Then

            If (Me.SeparateShippingCheckBox.Checked) Then
                Wizard1.MoveTo(Me.Step3)
            Else
                Wizard1.MoveTo(Me.Finish)
            End If

        End If
    End Sub

End Class
開發者ID:VB.NET開發者,項目名稱:System.Web.UI.WebControls,代碼行數:58,代碼來源:Wizard


注:本文中的System.Web.UI.WebControls.Wizard類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。