Add a Master Page to the Web Project
Right-click on the project and select Add->Add New Item to add a new MasterPage called "Site.Master" to the project:


If you switch into WYSIWYG design mode the Site.Master will look like this:

Now we are ready to have pages in our site pick up and use the master-page file.
Update Default.aspx and DataSample.aspx to use the Master Page
Open the default.aspx page we built in an earlier tutorial, and switch to HTML source-view. To update it to use the master-page go to the top <%@ Page %> directive and add a "MasterPageFile" attribute:
Then delete the static html previously on the page, and add an





Add a Web.SiteMap to the Web Project
Right-click on the project and select Add->Add New Item to add a new Site Map file called "Web.SiteMap" to the project:



This will then data-bind the Treeview against the web.sitemap file we created above. Choose the auto-format menu item in the "common tasks" menu and format it as "simple":

Note how the tree-view menu shows the current web.sitemap's hierarchy at design-time.
Press the F5 or Ctrl-F5 key to build and run the site:


Notice how the tree-view menu automatically highlights (by underlining - although you can style it however you want) the current node in the site-hierarchy as a user navigates around the site.
Click here to go to the next tutorial.
by webproject.scottgu.com
No comments:
Post a Comment