1 / 11

CSCI 6962: Server-side Desig n and Programming

CSCI 6962: Server-side Desig n and Programming. ASP Server Controls. Complex Form Elements. Checkboxes Text property gives label to display next to box Radio buttons Lists SelectionMode can be Single or Multiple. Lists and List Items.

kanoa
Download Presentation

CSCI 6962: Server-side Desig n and Programming

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. CSCI 6962: Server-side Design and Programming ASP Server Controls

  2. Complex Form Elements • Checkboxes • Text property gives labelto display next to box • Radio buttons • Lists • SelectionMode can beSingle or Multiple

  3. Lists and List Items • Edit Itemsinterface to add/edit items in this list • Add items to list • Set Text to appear next to it • Set Value to be passed as parameter if selected

  4. Radio Button Lists • Create as RadioButtonListto group together • Same Edit Itemsinterface

  5. ASP vs. HTML

  6. Reading CheckBoxes • Checkboxes have Checked property (True or False) • Use to add “Monitor” to peripheralLabel • Like string-based conditional output in JSF (<br/> adds line)

  7. Reading Radio Buttons/Lists • Simplest way to find out which element selected:.selectedValue property • Returns value associated with element (“” if none selected) • Lists handled same way

  8. Reading Multiple-Select Lists • Can use Selectedproperty to check each item in list • Use loop to iterate through all items • Listname.Items.Count gives number of items (loop from 0 to Count – 1) • Listname.Items(i) refers to ith item in list • Listname.Items(i).Selected true if ith item selected • Listname.Items(i).Text gives value of ith item

  9. Reading Multiple-Select Lists Number of items in SoftwareList Was ith item selected? Get text assocciated with ith item Keep count of selected items so know whether any selected

  10. Dynamic List Generation • Adding items to list using code (usually in Page_Load):listname.Items.Add(string) • Example: generating list of months using loop from 1 to 12

  11. Dates in ASP • Key: Date object • Date.Today used to get current time/date • Date.Today.property gets specific values(Year, Month, Day, Hour, …)

More Related