如何使用Sitemap和menu创建网站导航
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创建网站导航的更多相关文章
- 为SharePoint网站创建自定义导航菜单
转:http://kaneboy.blog.51cto.com/1308893/397779 相信不少人都希望把SharePoint网站内置的那个顶部导航菜单,换成自己希望的样式.由于SharePoi ...
- ASP.NET Web Forms - 网站导航(Sitemap 文件)
[参考]ASP.NET Web Forms - 导航 ASP.NET 带有内建的导航控件. 网站导航 维护大型网站的菜单是困难而且费时的. 在 ASP.NET 中,菜单可存储在文件中,这样易于维护.文 ...
- Sharepoint网站创建自定义导航全记录
转:http://tech.it168.com/a2009/1207/820/000000820524_all.shtml [IT168 技术文档]在一个Sharepoint网站中可以创建子网站,页面 ...
- 用CSS变形创建圆形导航
http://www.w3cplus.com/css3/building-a-circular-navigation-with-css-transforms.html 本文由陈毅根据SARA SOUE ...
- css网站导航-菜单
一个简单的网站导航效果: 效果案例:查看演示 css: ;;;} body{font-family: arial, 宋体, serif;font-size: 12px;} .menu{width:11 ...
- jquery单页网站导航插件One Page Nav
这是一个轻量级的jQuery的单页网站导航插件.增加了单击后平滑滚动导航和当你浏览不同的部分时自动选择正确的导航项. changeHash: false, 改变当用户单击导航,就改变changeHas ...
- 采用Visual Stuidio 2010 创建网站栏
采用Visual Stuidio 2010 创建网站栏 Visual Stuidio 2010 该项目模板使创建网站栏/内容类型和列表变得非常方便. 1. 管理员身份打开Visual Stuidio ...
- 使用 EasyUI 创建左侧导航菜单
使用 JQuery EasyUI 创建左侧导航菜单,菜单的数据由后台服务提供. 效果图 HTML 元素 <div id="menuAccordion"></div ...
- SharePoint 创建网站地图树视图及格式枚举截图
SharePoint 创建网站地图树视图及格式枚举截图 SharePoint首页隐藏掉左側导航以后,假设要以树视图呈现站点地图也非常easy. 仅仅须要复制v4.mas ...
随机推荐
- Twitter Storm源代码分析之ZooKeeper中的目录结构
徐明明博客:Twitter Storm源代码分析之ZooKeeper中的目录结构 我们知道Twitter Storm的所有的状态信息都是保存在Zookeeper里面,nimbus通过在zookeepe ...
- Android 摇一摇 之 震动片
声明:import android.os.Vibrator; Vibrator mVibrator; 取得震动服务的句柄: mVibrator = (Vibrator)getApplication() ...
- ajaxFileUpload + lua-resty-upload 上传文件
ajaxFileUpload下载地址 地址:http://pan.baidu.com/s/1mgJypz6 html页面 <!DOCTYPE HTML PUBLIC "-//W3C// ...
- ACM 图像有用区域
图像有用区域 时间限制:3000 ms | 内存限制:65535 KB 难度:4 描述 “ACKing”同学以前做一个图像处理的项目时,遇到了一个问题,他需要摘取出图片中某个黑色线圏成的区域以 ...
- UILabel 的属性(用法)方法
Label 中常用的方法属性 UILabel *label =[[UILabel alloc]initWithFrame:CGRectMake(90, 100, 140, 40)];//设置Label ...
- 蒟蒻修养之cf橙名计划2
29 由于第一篇没写题意导致大部分神题题解已经完全不知道在说啥了...所以还是重开一篇保平安... [303A]题意:求三个长度为$n(n<=10^5)$的排列$a,b,c$使得$a_i+b_i ...
- JDBC学习笔记2
数据库数据更新操作statement接口下操作:[代码] import java.sql.DriverManager;import java.sql.SQLException; public clas ...
- C#读取XML文件的方法
先写一个xml文件: <?xml version="1.0" encoding="utf-8" ?> <bookste> <!-- ...
- Mysql bench执行sql语句批量操作数据所遇到的问题
一.错误 rror Code: 1175. You are using safe update mode and you tried to update a table without a WHERE ...
- thinkphp条件查询和模糊查询的一些方法
#文章管理 public function adminArticle(){ $adminArticle=M("article"); $arr_seach=$this->sea ...