Wednesday, July 11, 2007

ASP.NET DropBox Calendar control

1. Create a New Web Project Assignment10
A. Add Web Page DropBox.aspx
B.
C. Use Header user control from the previous assignment. Format as shown.
1. Menu is not required.
D. Select a folder with at least 5 files with at least 3 having .DOC extension.
E. Bind a radiobuttonList as textfield=Name and the valuefield=path
F. Clicking on a radio button will download the selected file
1. Response.redirect to the path.
G. You will modify 3 times and print results for each of the following…
1. Bind directly to the DirectoryInfo object. No specified order.
2. Bind to a dataview sorted in descending Name order
3. Bind to a dataview sorted ascending, filtered so only .DOC’s are listed.
H. Print each showing the Listing and Download works.
1. Clearly label as each printout as one the above 3
I. Sample code to get you started:
1. Import System.IO
Dim DirInfo As New DirectoryInfo("c:\data\Classes\dotNET\Notes")
Dim FileItem As FileInfo
Dim dsFiles As New DataSet()
Dim dr As DataRow
Dim dv As DataView
dsFiles.Tables.Add("FileList")
dsFiles.Tables("FileList").Columns.Add("Path", Type.GetType("System.String"))
dsFiles.Tables("FileList").Columns.Add("Name", Type.GetType("System.String"))
For Each FileItem In DirInfo.GetFiles
dr = dsFiles.Tables("FileList").NewRow
dr("Name") = FileItem.Name
dr("Path") = FileItem.FullName
dsFiles.Tables("FileList").Rows.Add(dr)
Next
dv = dsFiles.Tables("FileList").DefaultView
dv.Sort = "Name ASC"
With rbtFilesList
.DataSource = dv
.DataTextField = "Name"
.DataValueField = "Path"
.DataBind()
End With
To redirect and open the file.
Private Sub rbtFilesList_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles rbtFilesList.SelectedIndexChanged
Response.Redirect(rbtFiles.SelectedItem.Value)
End Sub
2. Add Web Page Calendar.aspx
A. Use two raidobuttionlist server controls and NOT visible calendar
1. Calendar only displays when a employee is selected
B. Bind one raidobuttionlist to the “first letter” of the employee’s last name
1. Use distinct and left functions in your SQL statement
2. Result is a list of radio buttons, one letter each.
C. Upon selecting a letter; bind the other radio button list to all employees
with last name that begins with the letter.
D. Upon selecting an employee,
1. Make the calendar visible.
2. Display that employee’s birthdate in the calendar control
E. Upon selecting a different date make link button “Update” visible
F. Selecting Update will change the birthdate to the selected date.
G. Hide both the Update and calendar when a different letter is selected.
H.
I. Screen print to show it works
1. Select an employee and show the date gets updated.
2. And code.
3. Add WebForm SurfShots
A. Add AdRotator
B. Add images folder
C. Using images.goggle.com save 5 surfing pictures to the images folder.
D. Modify the Ads xml file from thebook to load the pictures
1. Replace data as necessary
2. Make one “ad” impressions = 5
3. Rest is up to you.
E. Create a ClickThrough.aspx page that displays the name of the image.
F. Print…two photo pages and associated ClickThrough link page
G. And Print the Ads.xml page!
4. Add WebPage State.aspx
A. Configure as follows
B.
C. On Test State Link button click
1. Name is stored in Session variable
2. Age is stored in 30 day cookie
3. Hair is passed in the QueryString in the response.redirect
4. Response.Redirect to StateTest.aspx
D. On TestState.aspx Display the values you stored.
5. Print your cookie with WordPad
A. C:\Documents and Settings\username\Local Settings\Temporary Internet
Files
6. Set View State Link Button
A. Set three StateView variables called School, Class, Grade.
Page 3