Share via


Creating Web Task ASP Pages for a Wizard Page

Server Appliance Kit

To create the ASP page for a wizard page, you must complete the following steps.

  1. Include the library file:

    <!-- #include virtual="/admin/inc_framework.asp" --> 
    

  2. Call the library function to create the page and show it:

    Dim retCode
    Dim page
    '
    ' Create a tabbed property page. Note that L_PAGE_TITLE and myImage
    ' are initialized elsewhere
    ' myImage should be an array to provide the small image for the
    ' title bar and the large image for the start and finish pages
    retCode = SA_CreatePage(L_PAGE_TITLE, myImage, PT_WIZARD, page)

' add as many pages as needed note L_ strings defined elsewhere retCode = SA_AddWizardPage(page, L_WIZ_INTRO_PAGE_TITLE, idIntro) retCode = SA_AddWizardPage(page, L_WIZ_PAGE_TITLE, idPage) retCode = SA_AddWizardPage(page, L_WIZ_FINISH_PAGE_TITLE, idFinish)

' show the page, which will allow the framework to call the ' needed event handlers retCode = SA_ShowPage(page)

  1. Provide the OnInitPage event function to perform any initialization needed:

    Public Function OnInitPage(ByRef PageIn, ByRef EventArgIn)
    ' Do initialization here
    OnInitPage = True 'indicates success
    End Function
    

  2. Provide the OnServeWizardPage event function to output the actual page:

    Public Function OnServeWizardPage(ByRef PageIn,
    ByVal iPageID,
    ByVal bIsVisible,
    ByRef EventArgIn)
    ' Provide code to output the content for the requested page
    Select Case iPageID
    Case idIntro
    'provide code to ouput this page
    'output should be different
    'if the page is visible
    Case idPage
    'provide code to ouput this page
    Case idFinish
    'provide code to ouput this page
    Case Else
    'handle error
    End Select
    OnServeWizardPage = True 'indicates success
    End Function
    

  3. Provide the OnWizardNextPage event function to determine the navigation sequence:

    Public Function OnWizardNextPage(ByRef PageIn,
    ByRef EventArgIn,
    ByVal iCurrentPageID,
    ByVal iPageAction,
    ByRef iNextPageID,
    ByRef iPageType)
    ' Provide code to determine the next page
    Select Case iCurrentPageID
    Case idIntro
    'bassed on the page action determine the next page
    'set iNextPageID and iPageType
    Case idPage
    'bassed on the page action determine the next page
    Case idFinish
    'bassed on the page action determine the next page
    Case Else
    'handle error
    End Select
    OnWizardNextPage = True 'indicates success
    End Function
    

  4. Provide the OnSubmitPage event function to perform the requested task:

    Public Function OnSubmitPage(ByRef PageIn, ByRef EventArgIn)
    ' Provide code to process the action
    ' Can call WMI directly or call a back-end task
    OnSubmitPage = True 'indicates success
    End Function
    

  5. Provide the OnPostBackPage event function to extract the configuration data from the form variables:

    Public Function OnPostBackPage(ByRef PageIn, ByRef EventArgIn)
    ' Provide code to save the state of the page
    OnPostBackPage = True 'indicates success
    End Function
    

  6. Provide the OnClosePage event function to perform any cleanup needed:

    Public Function OnClosePage(ByRef PageIn, ByRef EventArgIn)
    ' Provide code to process the action
    ' Can call WMI directly or call a back-end task
    OnClosePage = True 'indicates success
    End Function
    

Related Topics

Page Graphic

Adding a Web Task

Page Graphic

Adding a New Secondary Navigation Item

Page Graphic

Adding a Web Task to a Navigation Page

Page Graphic

Creating Web Task ASP for a Property Page

Page Graphic

Creating Web Task ASP for a Multitabbed Property Page