Homework Assignment #2
In class exercise
to get credit for this assignment,
you must do this exercise in class
and show the instructor your results.
start
programs
programming classes
visual studio 2005
visual studio 2005
select web development as the default
start visual studio
Create web site
Location should be: file system
Note the path for your project
e.g. D:\Documents and Settings\a213inst\My Documents\
Visual Studio 2005\WebSites\WebSite1
make sure Language is: Visual Basic
dbl click: ASP.net web site
at bottom on screen,
you should see: Design Source
It is critical
not to disturb code that is set up for you!!!
Note html tags
...
Note lines can be suppressed by clicking the [-] minus.
they can re-appear by clicking the [+] sign.
1. click on Design mode
2. key in: My first cs206 project
change the font to arial
change the pt size to 16
3. View
toolbars
turn off formatting
turn on formatting
4. enter a new line: enter a number
12 pt
Note in visual studio 2005,
we can use html (as shown in steps 2 and 4)
to add static text,
instead of using a static label.
5. position the cursor
dbl click on TextBox in the Toolbox
to add it to your form
6. unpin the solution explorer panel
7. list the properties of the textbox alphabetically
8. change the properties of the textbox
ID txtNumber
9. add a button below the text box
ID btnCalculate
Text: Calculate
Note: visual studio web devel uses flow layout
10. add text below to say:
Double that number is:
11. add a label
ID lblResult
12. Start without debugging
Ctrl F5
(on some stations, had to do this several times
before it worked)
URL that it brought up automatically was:
http://localhost:2596/WebSite1/Default.aspx
Note: if the station did not have internet access,
the program would not run.
13. close the browser, not Visual Studio
14. set lblResult text property to blank
15. dbl click on Calculate button
to open up a code window
16. unpin tool box and the properties
so the code screen takes up the full screen
17. add code for the btnCalculate
by dbl clicking the button
Dim dVal As Decimal
dVal = txtNumber.Text
lblResult.Text = 2 * dVal
18. File
Save All
19. run the program
(see step 12 above)