Design style elements in asp
Course:- DOT NET Programming
Reference No.:- EM13467

Assignment Help
Expertsmind Rated 4.9 / 5 based on 47215 reviews.
Review Site
Assignment Help >> DOT NET Programming

Add drop down lists for modifying the different style elements for the label element that displays the time.

We will do it via postback to the server. As it is for demonstration, you need to have only a few items in the drop-down lists.

For instance, I chose 4 background colors: Black, Red, Blue, Green; 4 foreground colors: White, lightPink, lightBlue, lightGreen; font-size: I used xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger

Note: I did not use lightRed because, it appears to be not supported: opinionatedgeek.com/DotNet/Tools/Colors/

For including a drop-down menu in your ASP form, from the ToolBox, choose Standard -> DropDownList. Once you have the DropDownList on the form, check the box Enable AutoPostBack; you can also do this by right clicking the DropDownList, select Properties and check that AutoPostBack is set to True.

Of course, you can also change the ID for the box, and any other properties you may want to change. You can add Items to a DropDownList by clicking Edit Items, or by going to Properties and selecting Items; it will say Collection, you can click on Collection, and it will open a box that will allow you to add items. You can add items, remove items, and even set the default value (when the page loads) have the Selected flag set to true.

Once you have added the DropDownLists (I will say try to do one DropDownList and see that it works to satisfaction, and then add the other lists), we need to specify the code for the actions in the code behind file. Remember that Page_Load will already have the necessary code to display the current time. In the ASP form, if we double click on any of the drop down lists, the necessary function for the drop down list (index changed function) will be created in the code behind file. Suppose the drop down list for changing the fonts is called list1, then we add this line to the code behind file for the index changed function for this list timeLabel.Style.Add("font-size", list1.SelectedValue); See that font-size is the property that we are changing, and list1.SelectedValue will give the value selected by the user. Similarly, we can modify the background color for timeLabel based on the value in list2 by: timeLabel.Style.Add("background-color", backgroundColorList.SelectedValue);

We can modify the foreground color for timeLabel based on the value in list3 by: timeLabel.Style.Add("color", fontColorList.SelectedValue);

Build your solution, and execute it, and see that it runs fine. Now, transfer the solution to the virtual machine, and see that the code runs fine. What to turn in: Turn in the URL on the web server to see that your code is working. Also turn in the entire folder created by Visual Studio for you (as a zip file), which also includes your aspx and code behind files.

Put your comment

Ask Question & Get Answers from Experts
Browse some more (DOT NET Programming) Materials
Incorporates a consistent look and feel (10 pts) and an easy-to-use and consistent navigation toolset across the site and the entire site must be built around a common CSS Box
The GET method is used for viewing something, without changing its value. The POST method is used for values that are not constant. In terms of security, which method do yo
Describe how can you enhance LINQ to SQL application performance? Provide examples. Ajax calls can be in form of a GET or POST. Which of these two options are you more likely
Managing validation becomes a rather onerous task when you have to design a contact form, an event registration form, a sign in form, etc. What are some form controls used
Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project. Allow the user to enter the number of cases
Task: Design and implement Tower of Hanoi Puzzle program using C# and Windows Presentation Foundation (WPF) template in Visual Studio 2012 or newer.
Write down a C# program to find average of test scores input by user. Use pseudocode in which user inputs number of test scores and each test score.
Please complete the following Programming Exercises listed in your book. All programs must be done according to these Programming Principles (properly formatted and commente