.net中使用xsl文件作為導航菜單的小例子_.Net教程
推薦:幾種判斷asp.net中session過期方法的比較幾種判斷asp.net中session過期方法的比較,需要的朋友可以參考一下
<%@ 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="http://站點導航列表">
<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>
分享:關于asp.net 自定義分頁控件本篇文章,小編將為大家介紹,關于asp.net 自定義分頁控件,有需要的朋友可以參考一下
- asp.net如何得到GRIDVIEW中某行某列值的方法
- .net SMTP發送Email實例(可帶附件)
- js實現廣告漂浮效果的小例子
- asp.net Repeater 數據綁定的具體實現
- Asp.Net 無刷新文件上傳并顯示進度條的實現方法及思路
- Asp.net獲取客戶端IP常見代碼存在的偽造IP問題探討
- VS2010 水晶報表的使用方法
- ASP.NET中操作SQL數據庫(連接字符串的配置及獲取)
- asp.net頁面傳值測試實例代碼
- DataGridView - DataGridViewCheckBoxCell的使用介紹
- asp.net中javascript的引用(直接引入和間接引入)
- 三層+存儲過程實現分頁示例代碼
- 相關鏈接:
- 教程說明:
.Net教程-.net中使用xsl文件作為導航菜單的小例子。