Web hosting servers - Next you populate the ListBox with some options.

Next you populate the ListBox with some options. Click Edit Items and use the ListItem Collection Editor (Figure 10-14) to list options to appear in the control. For each option, enter two things: Text: The text that appears in the box. This can be any text you want. Value: The value that the selection returns. This must exactly match the name of a Theme folder in the App_Themes folder. Each time you click the Add button, you re prompted to enter another item. In Figure 10-14, I ve added an option for each theme. I left the highlighter on the No Squint option to illustrate that it s okay to show No Squint as two words in the list. However, the value of that option must be NoSquint to match the name of the Theme folder. When you click OK in the ListItem Collection Editor, you ll be returned to the page and the options are visible. You can then set the height of the control by dragging its bottom edge (or by setting the Height property in the control s Properties dialog box). Storing the preferred theme When the user makes a selection from the ListBox, that control s SelectedValue property will equal the Value of the selected item. For starters, we need some code to copy the value to the user s PreferredTheme property. To get to the code-behind file, first double-click the ListBox control. The event handler for the ListBox is named ListBox1_SelectedIndexChanged. Figure 10-14: The ListItem Collection Editor. Chapter 10: Using Themes 213
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply