Creating Web Task ASP Pages for a Property Page
To create the ASP page for a property page, complete the following steps.
Include the library file. The following code sample shows how to do this.
<!-- #include virtual="/admin/inc_framework.asp" -->
Call the library function to create the page and display it. The following code sample shows how to do this.
Dim retCode Dim page ' ' Create a property page. Note that L_PAGE_TITLE and myImage ' are initialized elsewhere retCode = SA_CreatePage(L_PAGE_TITLE, myImage, PT_PROPERTY, page) If (retCode <> gc_ERR_SUCCESS) Then ' Handle error End If ' show the page, which will allow the framework to call the ' needed event handlers retCode = SA_ShowPage(page) If (retCode <> gc_ERR_SUCCESS) Then ' Handle error End If
Provide the OnInitPage event to perform any initialization needed. The following code sample shows how to do this.
Public Function OnInitPage(ByRef PageIn, ByRef EventArgIn) ' Begin initialization here OnInitPage = True 'indicates success End Function
Provide the OnServePropertyPage event to supply output to the actual page. The following code sample shows how to do this.
Public Function OnServePropertyPage(ByRef PageIn, ByRef EventArgIn) ' Provide code to output the page ' Make sure to define the Init() SetData() ' and ValidatePage() functions %> <script language='JavaScript' src='/admin/inc_global.js'> </script> <script language='JavaScript'> function Init() { // do any initialization needed } function SetData() { // modify hidden form fields if needed } function ValidatePage() { // verify that the entered data is okay } </script> <% OnServePropertyPage = True 'indicates success End Function
Provide the OnSubmitPage event to perform the requested task. The following code sample shows how to do this.
Public Function OnSubmitPage(ByRef PageIn, ByRef EventArgIn) ' Provide code to process the action ' Can call WMI directly or call a backend task OnSubmitPage = True 'indicates success End Function
Provide the OnPostBackPage event to extract the configuration data from the form variables. The following code sample shows how to do this.
Public Function OnPostBackPage(ByRef PageIn, ByRef EventArgIn) ' Provide code to save the state of the page OnPostBackPage = True 'indicates success End Function
Provide the OnClosePage event to perform needed cleanup. The following code sample shows how to do this.
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
Adding a New Secondary Navigation Item
Adding a Web Task to a Navigation Page