[ Pobierz całość w formacie PDF ]
.This program makes use of many labels-four to be exact-to providea dynamic page that updates with user feedback.In the old Webprogramming model, you probably would have provided such functionwith at least two separate Web pages, one of them custom-generatedby a CGI script on the server.The simple addition of the labelcontrol and VBScript enable you to integrate all this feedbackinto one relatively simple page.NoteA rather interesting behavior occurs with the label control if you don't include any parameter tag for the caption in your object declaration.When the label is drawn on screen, it will appear with the caption "Default!" You can still assignvalues to properties even if they are not declared with the parameter tag in an object declaration.You can change the caption at some point in your program if you start with this default caption.However, if you don't want to generate a caption until someinteraction with your program occurs, you would prefer that your user see nothing for the label rather than the confusing "Default" on screen.Setting the parameter equal to the empty string, as defined previously, solves thisproblem.SummaryToday's lesson provided an introduction to objects and ActiveXcontrols.An object is a component to be integrated into the page.An ActiveX control is one specific kind of object.A draft standardthat details how an object should be defined within a Web pagewas outlined in detail.The <OBJECT>tag declares the object, along with standard attributes that definea generic object.In addition, the <PARAM>tag defines properties uniquely provided by the specific objectthat has been declared.The ActiveX control technology evolved from the concepts of olderVisual Basic VBX controls and the more recent OCX controls basedon Microsoft's object linking and embedding (OLE) standards andtechnology.The ActiveX control encompasses OCX controls, whichcan be utilized in Web pages through VBScript.The lesson then examines the ActiveX label control in detail,outlining the properties, methods, and events of the control.With the label control, you can fully control the appearance ofa label placed on a Web page.This includes control of the color,the font, and even the angle of the text.The lesson providesseveral examples, including a program that allows experimentationwith changing the various label properties and a tutorial thatdemonstrates the high degree of user feedback that the pages thatintegrate this control can provide.Q&AQWhich object attribute provides a name for the object that your code will use to reference the object?AThe ID attribute designates a name for the object.QAre ActiveX controls available from sources other than Microsoft?AYes, you can purchase ActiveX controls from other vendors or even write them yourself if you have adequate expertise and tools.QCan a label be blank initially so the user doesn't see it until some later point in the script?AYes, just supply an empty caption by providing two double quotes with nothing between them for the caption parameter declaration of the object.The tutorial program used this technique.Keep inmind that you must supply an empty string.If you omit the caption parameter all together, the word "default" is supplied as the starting caption.QDoes a label control have any useful events?AYes, you can use the Click event to provide code that is executed when a label is clicked.WorkshopTake a Web page that you have previously developed and add a labelcontrol somewhere within it.Experiment with various properties,such as different colors and angles.Add several input commandbuttons, and write code associated with each button to providea different angle and color scheme for the label when you clickit.Assess your previously developed Web pages and see if youcan design one where a dynamically updated label would providevaluable feedback to the user, instead of just providing a jazzierlook.QuizNoteRefer to Appendix C, "Answers to Quiz Questions," for the answers to these questions
[ Pobierz całość w formacie PDF ]