主頁 > 知識庫 > .net中使用xsl文件作為導(dǎo)航菜單的小例子

.net中使用xsl文件作為導(dǎo)航菜單的小例子

熱門標(biāo)簽:Mysql連接數(shù)設(shè)置 阿里云 Linux服務(wù)器 團(tuán)購網(wǎng)站 銀行業(yè)務(wù) 科大訊飛語音識別系統(tǒng) 電子圍欄 服務(wù)器配置

復(fù)制代碼 代碼如下:

%@ 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 = @"站點導(dǎo)航列表 來訪員工=''>
                                          站點導(dǎo)航 站點名稱='設(shè)計計劃' 站點編號='EPM' 站點鏈接='../NWEPDI.EPM.WEB/../Project/ProjectList.aspx?QueueType=EPM0101' />
                                          站點導(dǎo)航 站點名稱='設(shè)計作業(yè)' 站點編號='DDM' 站點鏈接='../MoEngineer/ProjectMgr.aspx' />
                                          站點導(dǎo)航 站點名稱='設(shè)計流程' 站點編號='DFM' 站點鏈接='../MoFlow/CWorkItemList.aspx?QueueType=DFM0101' />
                                          站點導(dǎo)航 站點名稱='印務(wù)管理' 站點編號='PPM' 站點鏈接='../MoPrint/PrintMgr.aspx?QueueType=PPM0101' />
                                          站點導(dǎo)航 站點名稱='工時管理' 站點編號='WHM' 站點鏈接='../MoWorkHour/HourMgrPrj.aspx?QueueType=WHM0103' />
                                          站點導(dǎo)航 站點名稱='電子歸檔' 站點編號='ARC' 站點鏈接='../MoArchieve/ProjectMgr.aspx?QueueType=ARC0101' />
                                          站點導(dǎo)航 站點名稱='統(tǒng)計報表' 站點編號='SSM' 站點鏈接='../MoReports/ReportView.aspx?QueueType=SSM0101' />
                                          站點導(dǎo)航 站點名稱='資料管理' 站點編號='DAM' 站點鏈接='../MoDocument/ProjectFileMgr.aspx?QueueType=DAM0101' />
                                          站點導(dǎo)航 站點名稱='系統(tǒng)管理' 站點編號='DSM' 站點鏈接='../MoAdmin/CommonRuleList.aspx?QueueType=DSM0101' />
                                        /站點導(dǎo)航列表>";
        }
    }
}


?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://站點導(dǎo)航列表">
    div>
      ul>
        li>導(dǎo)航/li>
        xsl:for-each select="站點導(dǎo)航">
          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>

標(biāo)簽:廣元 棗莊 衡水 蚌埠 大理 萍鄉(xiāng) 衢州 江蘇

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《.net中使用xsl文件作為導(dǎo)航菜單的小例子》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266