.net中使用xsl文件作为导航菜单的小例子
2013-04-22 00:00
681 查看
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="testweb.WebForm1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Xml TransformSource="XSLTFile1.xslt" ID="minanva" runat="server"></asp:Xml> </div> </form> </body> </html> using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace testweb { public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { minanva.DocumentContent = @"<站点导航列表 来访员工=''> <站点导航 站点名称='设计计划' 站点编号='EPM' 站点链接='../NWEPDI.EPM.WEB/../Project/ProjectList.aspx?QueueType=EPM0101' /> <站点导航 站点名称='设计作业' 站点编号='DDM' 站点链接='../MoEngineer/ProjectMgr.aspx' /> <站点导航 站点名称='设计流程' 站点编号='DFM' 站点链接='../MoFlow/CWorkItemList.aspx?QueueType=DFM0101' /> <站点导航 站点名称='印务管理' 站点编号='PPM' 站点链接='../MoPrint/PrintMgr.aspx?QueueType=PPM0101' /> <站点导航 站点名称='工时管理' 站点编号='WHM' 站点链接='../MoWorkHour/HourMgrPrj.aspx?QueueType=WHM0103' /> <站点导航 站点名称='电子归档' 站点编号='ARC' 站点链接='../MoArchieve/ProjectMgr.aspx?QueueType=ARC0101' /> <站点导航 站点名称='统计报表' 站点编号='SSM' 站点链接='../MoReports/ReportView.aspx?QueueType=SSM0101' /> <站点导航 站点名称='资料管理' 站点编号='DAM' 站点链接='../MoDocument/ProjectFileMgr.aspx?QueueType=DAM0101' /> <站点导航 站点名称='系统管理' 站点编号='DSM' 站点链接='../MoAdmin/CommonRuleList.aspx?QueueType=DSM0101' /> </站点导航列表>"; } } } <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:output method="xml" indent="yes"/> <xsl:template match="//站点导航列表"> <div> <ul> <li>导航</li> <xsl:for-each select="站点导航"> <li> <xsl:value-of select="@站点名称"/> <xsl:attribute name="id"> <xsl:value-of select="@站点编号"/> </xsl:attribute> <xsl:attribute name="href"> <xsl:value-of select="@站点链接"/> </xsl:attribute> </li> </xsl:for-each> </ul> </div> </xsl:template> </xsl:stylesheet>
相关文章推荐
- .net中使用xsl文件作为导航菜单的小例子
- .net中使用xsl文件作为导航菜单
- .NET : 在单元测试中使用外部文件作为数据源
- .NET : 在单元测试中使用外部文件作为数据源
- 用.NET的File控件上传文件的解决方案(被动解决方案)(本文章来自于互联网,感谢原作者的辛勤劳动,摘抄在此仅作为学习使用!)
- .NET : 在单元测试中使用外部文件作为数据源
- 使用hovertree菜单作为后台导航
- 一个使用C#的TPL Dataflow Library的例子:分析文本文件中词频
- 使用jxl对excel写文件简单例子
- 模板:使用文件作为输入
- .NET开发使用Winform的配置文件App.config
- 使用nginx作为css,js,image静态文件的服务器
- .NET中对资源文件的使用简介
- CentOS 6.4 安装 FastDFS、使用Nginx作为文件访问WEB服务器
- .Net网络通讯编程[利用Socket实现字串、文件、序列化对象传输]--使用封装的网络服务4[聊天室]
- .NET使用资源文件resx、Resources
- 在Winform中菜单动态添加“最近使用文件”
- 实例讲解.NET中资源文件的创建与使用
- 使用 UIwebView 播放 gif 文件的代码例子
- 【Windows核心编程】一个使用内存映射文件进行进程间通信的例子