Homework Assignment #11
Most students completed this in class #10 on 4/23/2007.
copy this application to your E: drive
the source of the copy is:
u:\Moritsugu_steven\murach\Book Applications\Chapter_03\HalloweenStore
on the e: drive, make the name of this directory to be hmwk11
also copy this directory to your E: drive
u:\Moritsugu_steven\murach\files
Start Visual Studio
open a new web site
template asp.net web site
location: the HalloweenStore dir you just copied to your E: drive
It will automatically launch a wizard.
go ahead and convert this from visual studio 2003 format
to 2005 format.
In the solution explorer,
right click on order.aspx
set as start page
dbl click: order.aspx
click: design
Start without debugging
should get an error because the pathnames are wrong.
Start with debugging
this should bring up the line of code that needs to be changed.
change the path to the e: file directory where you copied the files
stop debugging
Start with debugging
you will get an error
change the pathname
stop debugging
Start with debugging
and not get an error.
Set a breakpoint at line 94 in order.aspx.vb (see p. 167)
Me.LoadProductDropDownList()
The line will be in brown when you successfully set the breakpoint.
start without debugging
change the category
If you don't see line numbers in your code,
Tools
Options
General
turn on: line numbers
On some stations, you must turn them on this way:
Tools
Options
Text Editor
basic
editor
turn on: line numbers
Remove the breakpoint
by clicking the brown bullet
the line will still be yellow to indicate
this is where the program is paused.
and you should hit the breakpoint
using Data tip (p 169)
still in breakpoint mode
put your cursor on lblCheckout.text in line 99
and it will show you the current contents of that control
also do this on txtQuantity.Text in line 84
click "step into" (p 171)
you should go to line 53 where loadproductdropdownlist starts
as you step through this routine (lines 57-61)
to change what line is executed next,
put your cursor in that desired line,
right click,
set next statement
Debugging windows on bottom left (p 173)
autos
locals
click the + sign to see the contents
watch
Stop debugging
add this code to btnAdd_click at line 67
Dim dVal As Decimal
dVal = 1
dVal += 2
dVal *= 3
dVal \= 4
(hint: copy this code from the web site to your program)
set a breakpoint at the dim statement
start debugging
add dVal in your watch window
by single click in an empty name field
Tell me what the \= operator does.
ans: integer divide
set Dval +=2 as the next statement to execute
and then step into it.
In the watch window,
change the value of dVal to 7
(will show as 7D for decimal)
then step into
so you can see it uses the new value.
Dbl click on sID in that subroutine
then drag sID to the watch window
if you cannot find a window
debug
windows
then the desired window
Immediate window
?dVal
?dVal*6
?dVal^2
dVal=5*7
?ddlCategories.SelectedItem.Text
"Costumes"
show the instructor your watch and immediate windows