1.添加Sitemap文件

将Sitemap内容替换为如下示例代码:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="default.aspx" title="Home" description="Sitemap example's home page">
<siteMapNode url="products.aspx" title="Products" description="Products listing page">
<siteMapNode url="products/product1.aspx" title="Product 1" description="" />
<siteMapNode url="products/product2.aspx" title="Product 2" description="" />
<siteMapNode url="products/product3.aspx" title="Product 3" description="" />
</siteMapNode>
<siteMapNode url="services.aspx" title="Services" description="Services listing page" >
<siteMapNode url="services/service1.aspx" title="Services 1" description="" />
<siteMapNode url="services/service2.aspx" title="Services 2" description="" />
<siteMapNode url="services/service3.aspx" title="Services 3" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>

2.添加Menu控件(Menu样式需依个人情况设置)
在Site.master(可以是任意页面)中拖入一个menu控件,设置Orientation="Horizontal",在设计模式中选择资料来源->新资料来源

再选择网站导览

至此,网站导航就创建完成了

效果如下: 若是不需要显示内置样式效果,请设置menu的属性IncludeStyleBlock="False",则黑色箭头会消失。

不同选项示例效果:

1.设置SiteMapDataSource中的属性

ShowStartingNode="False"

StartFromCurrentNode="True"

2.设置SiteMapDataSource中的属性

ShowStartingNode="True"

StartFromCurrentNode="False"

设置Menu中的属性StaticDisplayLevels="2"

如何使用Sitemap和menu创建网站导航的更多相关文章

  1. 为SharePoint网站创建自定义导航菜单

    转:http://kaneboy.blog.51cto.com/1308893/397779 相信不少人都希望把SharePoint网站内置的那个顶部导航菜单,换成自己希望的样式.由于SharePoi ...

  2. ASP.NET Web Forms - 网站导航(Sitemap 文件)

    [参考]ASP.NET Web Forms - 导航 ASP.NET 带有内建的导航控件. 网站导航 维护大型网站的菜单是困难而且费时的. 在 ASP.NET 中,菜单可存储在文件中,这样易于维护.文 ...

  3. Sharepoint网站创建自定义导航全记录

    转:http://tech.it168.com/a2009/1207/820/000000820524_all.shtml [IT168 技术文档]在一个Sharepoint网站中可以创建子网站,页面 ...

  4. 用CSS变形创建圆形导航

    http://www.w3cplus.com/css3/building-a-circular-navigation-with-css-transforms.html 本文由陈毅根据SARA SOUE ...

  5. css网站导航-菜单

    一个简单的网站导航效果: 效果案例:查看演示 css: ;;;} body{font-family: arial, 宋体, serif;font-size: 12px;} .menu{width:11 ...

  6. jquery单页网站导航插件One Page Nav

    这是一个轻量级的jQuery的单页网站导航插件.增加了单击后平滑滚动导航和当你浏览不同的部分时自动选择正确的导航项. changeHash: false, 改变当用户单击导航,就改变changeHas ...

  7. 采用Visual Stuidio 2010 创建网站栏

    采用Visual Stuidio 2010 创建网站栏 Visual Stuidio 2010 该项目模板使创建网站栏/内容类型和列表变得非常方便. 1. 管理员身份打开Visual Stuidio ...

  8. 使用 EasyUI 创建左侧导航菜单

    使用 JQuery EasyUI 创建左侧导航菜单,菜单的数据由后台服务提供. 效果图 HTML 元素 <div id="menuAccordion"></div ...

  9. SharePoint 创建网站地图树视图及格式枚举截图

    SharePoint 创建网站地图树视图及格式枚举截图         SharePoint首页隐藏掉左側导航以后,假设要以树视图呈现站点地图也非常easy.         仅仅须要复制v4.mas ...

随机推荐

  1. 使用linux命令行配置无线网链接

    1. 需安装wpa_supplicant https://wiki.archlinux.org/index.php/WPA_Supplicant_%28%E7%AE%80%E4%BD%93%E4%B8 ...

  2. hdu2612 Find a way

    Problem Description Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. L ...

  3. 据说最近IMO中国队失利的一题

    (图基于Microsoft PaintBrush技术构建) 平面几何是可以难得出蛆的.这道题难在多圆.高度非对称和具有一定复杂性.如图,对ABC,H是垂心,O是垂足,M是中点.QK在ABC外接圆上,均 ...

  4. Leetcode Binary Tree Postorder Traversal

    Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary t ...

  5. 通过hibernate session.connection()获得数据库连接时,导致的查询缓慢甚至假死机问题

    在使用hibernate的应用中,如果需要直接使用Java.sql.Connection,一般我们是通过hibernate的session.connection()获得的,然后session.clos ...

  6. js正则表达式校验非负整数:^\d+$ 或 ^[1-9]\d*|0$ 【转载】

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. 使用C#实现FTP的文件上传和下载【转】

    参考博文:http://blog.163.com/mity_rui@126/blog/static/1098136182013101525615577/  

  8. Spring 整合 Redis(二)

    pom构建: <modelVersion>4.0.0</modelVersion> <groupId>com.x.redis</groupId> < ...

  9. Lanterns

    Lanterns 题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86640#problem/B 题目: Description ...

  10. [转载]触发ASSERT(afxCurrentResourceHandle != NULL)错误的原因

    触发ASSERT(afxCurrentResourceHandle != NULL)错误的原因 Debug Assert error afxwin1.inl line:22 翻译参考 http://w ...