Assignment 5 - Portfolio
Assignment 5 cancelled Spring 09. - The
following two exercises may be used as ideas for a term project.
ZipLookupMap.aspx
- Google maps provides an API (Application Programming
Interface) that makes it surprisingly easy to integrate Google maps into
web applications (see
Google Maps
API). The maps are displayed inside an Ifram using JavaScript. To
display a map you only need to populate the JavaScript with the location that you would
like displayed. In this exercise you will modify
AjaxAspNet.aspx to display a Google map of the selected zip
code. Steps:
- Run the working sample and display a map. Then view the page
source code. You should see a snippet
of JavaScript in the page header and a div tag near the bottom of
the page. Notice the latitude and longitude that has been added to
the JavaScript from the zipcode database. The JavaScript sends the map location information to
Google, retrieves the map information and displays the map in the
div tag.
- Copy your exericse
AJAXAspNet.aspx.
Remove the ScriptManager and UpdatePanel. Add the JavaScript and the div tag
from the sample's source code. Test it. It should display the
same map that you viewed in the previous step.
- The next step is to make the map dynamic by feeding latitude and
longitude information from the database into the JavaScript.
- The database contains the latitude and longitude for each zip
code. This information is needed to position the map so we will add
it to the value field of the radioButtonList (or dropdownList) used
to display the zip codes. The modified sql statement is something
like:
SELECT distinct zip, Latitude + ',' + longitude as LatLong
FROM tblZipCodes
WHERE state = '" + dlState.SelectedItem.Text + "' AND city =
'" + dlCity.SelectedItem.Text + "'"
- The syntax to bind "LatLong" to the radioButtonList (or
dropdownList) is:
rblZips.DataValueField = "LatLong";
- To add LatLong to the map's JavaScript (needed in two locations)
use syntax something like:
<% =rblZips.SelectedValue %>
Portfolio -- Create a portfolio that displays your
work from MIS 314, MIS 324, and MIS 424 (and internship if you have one). You may display your information in any way that you think is most effective.
The following steps use the .NET navigation controls. They are
recommended but not required. Steps:
- Create a new folder named "Portfolio."
- Create a MasterPage.master with the site layout.
- The sample site uses a treeView control for the left hand menu and a SiteMapPath control for the breadcrumbs.
- The site layout information is located in a Web.sitemap file (documentation). By default the SiteMapPath control looks in the root folder for the Web.sitemap file. However, to keep your files organized it is more convenient to locate the sitemap in the "Portfolio" folder. You can change the default location by adding the following to the web.config file in your root directory.
<system.web>
<siteMap defaultProvider="MyXmlSiteMapProvider" enabled="true">
<providers>
<add name="MyXmlSiteMapProvider"
description="SiteMap provider that reads in .sitemap files."
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
siteMapFile="~\portfolio\web.sitemap" />
</providers>
</siteMap>
</system.web>
- Page titles are important for both search engines and for
browsers that use tabs. Titles may be specified within each .aspx file but an easier way is to include them in the "description" field of the website map. The following code reads the titles from the sitemap and display them on each aspx page:
Sub page_load()
LoadPageTitle()
End Sub
Sub LoadPageTitle()
Dim currentNode As SiteMapNode = SiteMap.CurrentNode
If Not currentNode Is Nothing Then
Dim subTitle As String = currentNode.Description
If subTitle.Length = 0 Then subTitle = currentNode.Title
If subTitle.Length <> 0 And subTitle <> "Home" Then
Page.Title = Server.HtmlEncode(subTitle) & " -- A. Star Student portfolio"
End If
End If
End Sub
To submit your assignment for grading send an email with the URLs for your assignment to:
- Professor Sandvig at
.
(note: this address is for homework assignments only - please send
other correspondence to
).
- cc. a copy to yourself.
The subject line of your email should read "MIS424 AXX YourName" where XX
is the assignment number. Please check that your URLs are correct before submitting them for grading.
Files with incorrect URLs will not be graded.