.net中使用xsl文件作为导航菜单的小例子
<%@ 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菜单作为后台导航
- [转]使用.net 程序生成 Excel 和Access 文件
- [转]使用.net 程序生成 Excel 和Access 文件
- [转]使用.net 程序生成 Excel 和Access 文件
- 使用 .NET 框架将现有代码作为 Web 服务提供
- 如何使用.NET配置文件(二)
- 实例讲解.NET中资源文件的创建与使用(转)
- 简单的使用.NET非对称加密算法的例子
- 使用.NET类库操作CSV文件
- 如何使用.NET配置文件
- 简单的使用.NET对称加密的例子
- CodeProject - 在C#使用SHGetFileInfo获取(管理)文件或者文件夹图标(C#封装Win32函数的一个例子)
- CodeProject - 使用.NET配置文件appSettings元素的File属性
- 如何使用.NET配置文件(二)