How to use the ASP to generate the homepage of the installation wizard

zhaozj2021-02-16  51

How to use the ASP to generate the main problem facing the home page of the installation wizard: 1. The interface is exactly the same as a Windows Wizard, with the Next and Back button 2. The user can use the Back button to return to the previous step and can change the contents already selected in any of the previous steps. FORM must remember all filled contents 4. Database 5 cannot be used. You cannot use Sessions to prevent all users' input lost after sessiosn failure, unfortunately, can also use cookies because many support often turn off the browser's cookie option. 6. The portability is good because it should be adapted to the case where the installation step number is different: 1. Transfer parameter 2 using the Hidden variable. Using the POST mode, do not use the GET mode because this method is limited to 3. Each page must have a function 4 for reading the submitted value. Every page (except for the first page) must have a Hidden Form to pass a page forwarding parameters

If you use CheckBoxes in your page or use Radio Buttons, use the following code read value: <% for each item in request.formif request.form (item) .count thenfor = 1 to request.form (item " ) .Ctresponse.write "item =" & item & "index =" & infoop "
" NEXTELSE RESPONSE.WRITE "Item =" & item & "
" end ifnext%>

In the design, special processing methods are used for Checkboxes and Radio: 1. Only the latest values ​​are considered to be used in these two ways to save 2. Users can use back to change the value of the previously entered, but must be submitted after submission to take effect 3. The page must be able to cope with multiple Controls in a page.

Specific implementation: The Nth page should be: 1. The first form: Its Action = Page (n 1) .ASP and the bottom must have a NEXT button 2 at the bottom. Second form: Its an action = page (n-1) .asp and back button 3. Variable Naming Rules: Example: N_ The suffix is ​​the type of control. is a NAME that represents the second page is Radio's thing 4. A function page used to read the submitted function page is based on a loop to determine which current control belongs to. The code is as follows: <% @ language = "vbscript%>

---------------------------------------------- ---------------> <% PAGENO = "_P2" for Each Item in Request.formWhichpage = INSTR (1, CSTR (Item), Pageno, 1) IF ((Request.form (item) .count) and (WhichPage = 0)) ThensTrcount = Request.form (item) .count strient = Request.form Response.write "" & vbrlfselseif (not Request.form (item) .count) and (whichpage = 0)) ThenRESPONSE.WRITE "" & Vbcrlfend ifnext%> <1-- read function end -> <% Function Check_uncheck (ctrlname, ctrlvalue) DIM CtrlName_indim Ctrlvalu E_INDIM CTRLVALUE_ACTUALDIM OUTSTR

ctrlValue_in = "" ctrlName_in = "" ctrlValue_actual = "" outStr = "" ctrlName_in = ctrlName_in & ctrlNamectrlValue_in = ctrlValue_in & ctrlValueIf Request.Form (ctrlName_in) .Count ThenstrCount = Request.Form (ctrlName_in) .CountctrlValue_actual = Request.Form (ctrlName_in) (strCount) If ctrlValue_actual = ctrlValue_in ThenoutStr = "CHECKED" End IfElse ctrlValue_actual = Request.Form (ctrlName_in) If ctrlValue_actual = ctrlValue_in ThenoutStr = "CHECKED" End IfEnd IfCheck_UnCheck = outStr End Function%>

<% StrItem1 = "" strItem1a = "" For Each Item1 in Request.FormIf Request.Form (Item1) .Count ThenstrCount1 = Request.Form (Item1) .Count strItem1 = Request.Form (Item1) (strCount1) Response.Write "

Stritem1 = "" stritem1a = ""%>

转载请注明原文地址:https://www.9cbs.com/read-24040.html

New Post(0)