Comprehensive OO ASP, construct your own WebForm object! (Instance)

zhaozj2021-02-16  64

Rendering: http://blog.9cbs.net/xiaoqy/gallery/Image/4414.aspx

Templates.js: http://blog.9cbs.net/xiaoqy/archive/2004/07/16/43454.aspx

Form.js: http://blog.9cbs.net/xiaoqy/archive/2004/07/16/43457.aspx

Basic.js: http:/blog.9cbs.net/xiaoqy/archive/2004/07/16/43459.aspx

Form.asp

<% @ Language = "JScript"%> <% // Create a AspTemplate object var TPL = new aspteMplate (); tpl.setfile ("file", "form.tpl"); var form = new Form ("FORM");

// Create a text box object var input = new text (); input.init ('name', "http_host"); input.setdesc ("text, password, multi-line text, hidden"); input.setpattern (" [0-9] "); form.addelement (input);

VAR f = new text (); f.init ("ffffffffffffffff", "test"); form.addelement (f);

// Create a selection list object var s = new select (); sinit ("s", "3"); s.setdesc ("select list, radio, multi-selection"); s.buildvalue ("a , B, C, D, E, F, G "); form.addelement (s);

// Create a radio button object var R = new radio (); R.INIT ("r", "a"); R.SetDesc ("radio button); R.BuildValue (" A, B, C) , D, E, F, G, H, J "); R.Radioassign (TPL," File "," ", 3); Form.Addelement (R);

// Create a multi-select button object // call other file TPL.SetFile ("OtherFile", "OtherFile.tpl");

Var c = new checkbox (); c.init ("c", "a"); C.SETDESC ("Select box, radio, multi-selection"); C.BUILDVALUE ("A, B, C, D, E, F, G, H "); C.checkboxassign (TPL," OtherFile "," ", 2); Form.Addelement (C); Form.AssignfortPL (TPL);

// Resolution Output Main File Tpl.Parse ("OtherFiles", "OtherFile"); TPL.PARSE ("Main", "File", RESPONSE.WRITE (TPL.P ("main")); //// TPL.SHOWALL ();%> template:

Form.tpl

{text} {broker} {{{{{{{{{{{}} = "Submit" value = "submit">

{FORM_ERRORMSG}

OtherFile.tpl

{text} { Broken}

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

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.034, SQL: 9