With Christmas fading to nothing more than a pleasant memory (except around the waistline where the consequences of unbridled gustatory abandon has left its seasonal evidence) we need to get fit again by leaping into an Active Server Page technology workout.So let’s get fancy. Suppose we want to let the user choose the size of an array of radio buttons on a Web page and we want each button to be linked to client-side JavaScript. This means that we’ll need to create the array on the fly and generate a handler for each button in the array. Here’s a Web page that we’ll use to specify the size of the array: 1 Array CreatorRows: Columns: Load this page and fill in the form entering, say, seven in the Rows field and six in the Columns field, and hit submit. This will create an HTTP request that will request array2.asp. This page looks like (for brevity we’ve only shown the code in the body and included line numbers for reference): 2 MaxRows = Request.Form(“rows”) 3 MaxCols = Request.Form(“cols”) 4 For intR = 1 to MaxRows 5 For intC = 1 to MaxCols 6 %> 7 8 OnClick = “Button_Click()”> 9 10 11 12 13 14 For intR = 1 to MaxRows15 For intC = 1 to MaxCols16 %>17 SubButton_Click()18 MsgBox “That is column , row .”19 End Sub20 21 Next22 Next23 %>24 Here’s where we meet a major architectural feature of ASP: The IIS Object Model. The model is based on six core objects: Application, ObjectContext, Request, Response, Session and Server. Each one of these objects has its own events, properties, methods and collections (objects that contain a set of related objects).In the ASP page above, lines 2 and 3 use the Request object to retrieve the arguments submitted by the form in the first Web page using the HTTP POST method. The Request object gives you access to the HTTP header and body and the “Form” object is the collection of all the POST items. Note that “Request.Form” is an abbreviated version of “Request.Form.Item” – the “Item” property is used to get a specific element in the collection by name. This means that we could have written lines 2 and 3 more properly as:2 MaxRows = Request.Form.Item("Rows")3 MaxCols = Request.Form.Item(“Cols”)This code retrieves the arguments by their explicit names, that is “Rows” and “Cols,” respectively.If we didn’t know the names but knew that the order of the arguments, then we could use the following code to retrieve the correct values:2 MaxRows = Request.Form. (Request.Form.Key(1))3 MaxCols = Request.Form. (Request.Form.Key(2))The “Key” property is used to get items by number. If we had had a variable number of arguments to handle then we could get a count of how many arguments are in the Request object using:NumArgs = Request.Form.CountThe array2.asp Web page consists of sections of scripting and other sections HTML content. The scripts are framed by “”. But we also have scripting inside the tags “ “. Our generated VBScript (to be executed on the browser) will be inside these tags.Get these files from www.gibbs.com/021223; put the ASP page in a server subdirectory where it can be executed (put the form that requests the page in the same directory for the sake of simplicity). Send your variables to gearhead@gibbs.com. Related content how-to Doing tricks on the Linux command line Linux tricks can make even the more complicated Linux commands easier, more fun and more rewarding. By Sandra Henry-Stocker Dec 08, 2023 5 mins Linux news TSMC bets on AI chips for revival of growth in semiconductor demand Executives at the chip manufacturer are still optimistic about the revenue potential of AI, as Nvidia and its partners say new GPUs have a lead time of up to 52 weeks. By Sam Reynolds Dec 08, 2023 3 mins CPUs and Processors Technology Industry news End of road for VMware’s end-user computing and security units: Broadcom Broadcom is refocusing VMWare on creating private and hybrid cloud environments for large enterprises and divesting its non-core assets. By Sam Reynolds Dec 08, 2023 3 mins Mergers and Acquisitions news analysis IBM cloud service aims to deliver secure, multicloud connectivity IBM Hybrid Cloud Mesh is a multicloud networking service that includes IT discovery, security, monitoring and traffic-engineering capabilities. By Michael Cooney Dec 07, 2023 3 mins Network Security Cloud Computing Networking Podcasts Videos Resources Events NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe