Share
Explore BrainMass

Creating a basic VB Web Application

Create a Visual Studio 2008 ASP. NET Web Site with two Web Forms. The name of your Web site should be based on your last name. For example, if your last name is Jones, then assign the name Jones_IP2.

The first Web Form contains one Label server control, two TextBox server controls, and two Button server controls with the Text "Compute Area" and "Compute Perimeter." The Label server control contains the Text, "Enter numbers in the text boxes and then click a button to perform the calculation." Use a Try-Catch code block to display an error message if the user inputs a value less than or equal to zero in either of the TextBox server controls. Use validator server controls to validate each TextBox server control to verify the user entered something into each TextBox server control and that the entered value can be converted to a number.

The second Web Form contains a Label server control. Use cross-page posting to display a message in the Label server control on the second Web Form when the user clicks one of the calculation Button server controls on the first Web Form. For example, if the user enters "4" and "5" in the TextBox server controls on the first Web Form and then clicks the "Compute Area" button server control, the second Web Form will display the message "The area of a 4 by 5 rectangle is 20" displayed in the Text property of the Label server control. If the user enters the same values and clicks the "Compute Perimeter" Button server control, the second Web Form will display the message "The perimeter of a 4 by 5 rectangle is 18" displayed in the Text property of the Label server control. The message must include the values input by the user, the selected calculation to perform and the calculated value. Use a decision structure to assign different colors to the font of the Label server control based on the calculated value. If the calculated value is greater than 100, the output in the Label server control should display in a red font. If the calculated value is greater than or equal to 50 and less than or equal to 100, the output in the Label server control should display in a green font. If the calculated value is less than 50, the output in the Label server control should display in a blue font. The Label server control should also display an error message to the user if they tried to input a value that was less than or equal to zero in either of the TextBox server controls on the first Web Form.

Solution Summary

This solution contains a basic VB Web Application with two web forms.

$2.19