1 / 19

INPUT FORMS

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

Download Presentation

INPUT FORMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. INPUT FORMS

  2. 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

  3. 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

  4. <form> TAG • OLD HTML (RENDERED) • <FORM METHOD=POST ACTION=RECEIVE.ASP> • . • . • . </FORM> • NEW ASP.NET (DYNAMICALLY CREATED) • <FORM ID=“MYFORM” RUNAT=“SERVER”> • </FORM>

  5. REASONS • MAINTAIN STATE • NEW CONTROLS • CALENDARS • GRIDS • SOME STANDARD DATA VALIDATION

  6. 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>

  7. MORE SERVER CONTROLS • RADIO BUTTONS • <ASP:RADIOBUTTON> • <ASP:RADIOBUTTONLIST> • CHECKBOX • <ASPCHECKBOX> • <ASP:CHECKBOXLIST> • SUBMIT • <ASP:BUTTON>

  8. <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

  9. <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>

  10. VIEW SOURCE • <FORM NAME = “CTR10” • METHOD = “POST” • ACTION =“DROPDOWNLIST_X.ASPX” • ID=“CTR10”> • <INPUT TYPE = HIDDEN • NAME = “_VIEWSTATE” • VALUE = ………. />

  11. <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>

  12. <asp:textbox>

  13. <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” />

  14. <ASP:TEXTBOX> • DEFAULT VALUES • (WHY ARE WE NOT ABLE TO PUT DEFAULT VALUES IN MULTILINE TEXTBOX?)

  15. <ASP:RADIOBUTTON> • (FOR A SINGLE BUTTON • SORT OF LIKE CHECKBOX?)

  16. <ASP:RADIOBUTTONLIST> • CAN SELECT ONLY ONE

  17. <ASP:CHECKBOX> • <ASP:CHECKBOX ID=“CHK_QUICKSHIP” RUNAT = “SERVER”> • WHAT IS THE VALUE THAT IS TRANSMITTED? • HOW DO WE MAKE “SELECTED” A DEFAULT?

  18. <ASP:CHECKBOXLIST>

  19. www.w3schools.com/aspnet/aspnet_examples.asp

More Related