190 likes | 637 Views
INPUT FORMS BOOK DEFINITIONS WEB PAGE A PAGE MARKED UP WITH HTML ONLY HTML FORM INPUT FORM TO SEND DATA TO SERVER CAN BE DONE USING ONLY HTML (AS IN ASP) WEB FORM TWO SEGMENTS HTML TEMPLATE PAGE LAYOUT ASP.NET SERVER CONTROLS ASP.NET CODE INCLUDES PROCESSING LOGIC
E N D
BOOK DEFINITIONS • WEB PAGE • A PAGE MARKED UP WITH HTML ONLY • HTML FORM • INPUT FORM TO SEND DATA TO SERVER • CAN BE DONE USING ONLY HTML (AS IN ASP) • WEB FORM • TWO SEGMENTS • HTML TEMPLATE • PAGE LAYOUT • ASP.NET SERVER CONTROLS • ASP.NET CODE • INCLUDES PROCESSING LOGIC • GENERATES DYNAMIC CONTENT • DISPLAY THROUGH ASP CONTROLS IN HTML TEMPLATE
DIFFERENCE • HTML • ONLY HTML TAGS WERE PROCESSED • IF IT DID NOT RECOGNISE A TAG, IT IGNORED • ASP.NET FORM • SERVER CONTROLS INCLUDED BETWEEN <HTML> TAGS
<form> TAG • OLD HTML (RENDERED) • <FORM METHOD=POST ACTION=RECEIVE.ASP> • . • . • . </FORM> • NEW ASP.NET (DYNAMICALLY CREATED) • <FORM ID=“MYFORM” RUNAT=“SERVER”> • </FORM>
REASONS • MAINTAIN STATE • NEW CONTROLS • CALENDARS • GRIDS • SOME STANDARD DATA VALIDATION
ASP.NET SERVER CONTROLS (P. 75) • DISPLAY TEXT • <ASP:LABEL> • CHOOSE FROM LIST OF ITEMS • <ASP:LISTBOX> • DROPDOWN LIST • <ASP:DROPDOWNLIST> • TYPED INPUT • <ASP:TEXTBOX>
MORE SERVER CONTROLS • RADIO BUTTONS • <ASP:RADIOBUTTON> • <ASP:RADIOBUTTONLIST> • CHECKBOX • <ASPCHECKBOX> • <ASP:CHECKBOXLIST> • SUBMIT • <ASP:BUTTON>
<ASP:LABEL> • <HTML> • <ASP:LABEL ID=“MSG” RUNAT=“SERVER” TEXT = “JOE” /> • <HTML> • JOE • _________________________________________________________ • <SCRIPT> • SUB PAGE_LOAD( ) • MSG.TEXT = “SINCLAIR LEWIS” • END SUB • </SCRIPT> • <HTML> • <ASP:LABEL ID=“MSG” RUNAT=“SERVER” TEXT = “JOE” /> • <HTML> • SINCLAIR LEWIS
<ASP:DROPDOWNLIST> • <FORM RUNAT=“SERVER”> • CHOOSE CITY: <br> • <asp:dropdownlist id=“city” runat=“server”> • <asp:listitem>NewYork </asp:listitem> • <asp:listitem>NewBoston </asp:listitem> • <asp:listitem>NewDallas </asp:listitem> • </asp:dropdownlist>
VIEW SOURCE • <FORM NAME = “CTR10” • METHOD = “POST” • ACTION =“DROPDOWNLIST_X.ASPX” • ID=“CTR10”> • <INPUT TYPE = HIDDEN • NAME = “_VIEWSTATE” • VALUE = ………. />
<asp:listbox> • <asp:listbox runat = “server” id=“city” selectionmode=“multiple”> <asp:listitem>London</asp:listitem> <asp:listitem>Moscow</asp:listitem> </asp:listbox> Question: can we use selectionmode = “multiple” in <asp:dropdownlist>
<asp:textbox> • <asp:textbox id=“txtName” runat=“server: /> • <asp:textbox id=“txtMore” runat = “server” textmode = “multiline” rows = 5 /> • <asp:textbox runat=“server” id=txtPW textmode = “password” />
<ASP:TEXTBOX> • DEFAULT VALUES • (WHY ARE WE NOT ABLE TO PUT DEFAULT VALUES IN MULTILINE TEXTBOX?)
<ASP:RADIOBUTTON> • (FOR A SINGLE BUTTON • SORT OF LIKE CHECKBOX?)
<ASP:RADIOBUTTONLIST> • CAN SELECT ONLY ONE
<ASP:CHECKBOX> • <ASP:CHECKBOX ID=“CHK_QUICKSHIP” RUNAT = “SERVER”> • WHAT IS THE VALUE THAT IS TRANSMITTED? • HOW DO WE MAKE “SELECTED” A DEFAULT?