Asp. NET Web Site template implementation (2nd section) _ Practical skills

Source: Internet
Author: User

Our main learning task is to master the use of site map files and site navigation controls and to master the way to create master pages and generate content pages, and start learning.
Learning content:

The first step, the site's breadcrumbs navigation
1, create the ASP.net application, run visual Studio2008, select "File" → "new" → "project" in the menu bar to operate.
2. In the Solution Explorer Panel, right-click Solution ' 0931 ' and choose Add → new Web site command from the pop-up shortcut menu to create a new E:\0931\Navigation site.
3, create the site map file (Web.sitemap). In the Solution Explorer panel, right-click the site name navigation and select Add New Item from the shortcut menu that pops up. In the Add New Item dialog box that pops up, select the site Map template and click the Add button. Web. The Sitemap section has the following code:

<sitemapnode title= "Computer software technology professional 0931" description= "url=" ">
 <sitemapnode title=" Home "description=" "Url=" Default.aspx ">
 <sitemapnode title=" User Login "description=" "Url=" ~/login/login "> 

4, for 0931 home default.aspx to create breadcrumbs Web site navigation. In Visual Studio 2008, in the Solution Explorer panel, right-click the site name navigation and select Add New Item from the shortcut menu that pops up. In the Add New Item dialog box that pops up, select the Web Forms option, the name is default.aspx, the code is placed in a separate file by default, and click the Add button.
Switch to Design view and drag the SiteMapPath control from the left Toolbox navigation group.
Default.aspx page part of the code is as follows:

<div class= "Head_layer" > 
 </div>
<div class= "Sitemappath_layer" > 
 </div>
<div class= "Foot_layer" > 
 </div>

Run default.aspx to see the effect.
5, the same step to create 0931 User landing page/login/login.aspx, and add breadcrumbs for its navigation.
6, for breadcrumbs navigation format, switch to Design view, right-click the SiteMapPath control, in the pop-up shortcut menu, select the AutoFormat command, for editing.
Step Two, add the hot zone
question one: How to calculate the hot zone?

Note: What is the difference between image and ImageMap?
Image control to add a page banner picture
The ImageMap control is used to add a navigate navigation bar picture and to set a hot area in the navigation bar picture (used to provide hyperlinks)
step three, create the master page
Create a master page. In Visual Studio 2008, in the Solution Explorer panel, right-click the site name navigation and select Add New Item from the shortcut menu that pops up. In the Add New Item dialog box that pops up, select the master page, and the extension is master. This is named "Banji.master" and click the "Add" button.
step Fourth, create a content page
The first method:
(1) Create a normal Web Forms page. Right-click the Banji folder and select the "Add New Item" command from the pop-up shortcut menu to create the paging file.
(2) Transform the creation page into a content page
(3) Running
The second method:
(1) Add content pages directly to the master page.
(2) In the Solution Explorer panel, right-click the site name, select Add New item on the pop-up shortcut menu, select the Select master Page check box when the added Web Form generates an ASPX page, and select the master page that you want in the dialog box for the selected master page that pops up later.

Run Effect chart:

Summarize
Through this section of the study, began to truly contact Dynamic Web site. In the learning process, the use of SiteMapPath design breadcrumbs, the first time you learn debugging can not link, check the reason code spelling errors, and the hot zone to learn, about this, in the setting should be accurate value, if you can use Dreamweaver, Next set the master page, the whole learning process knowledge is large, need to grasp the knowledge through a short period of time, there are some difficulties, so usually we have to strengthen the exercise, practice makes perfect.

Hope that this lesson site template and breadcrumbs to achieve the operation of the navigation, for everyone to learn in the future help.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.