這裡我就用xml代替數據
contents
<?xml version=
<topiclist type=
<topic>
<title>aspcool news!</title>
<href>main
</topic>
<topic>
<title>Resolve a problem</title>
<href>main
</topic>
</topiclist>
這是一個很簡單的xml文件
hello
<?xml version=
<document>
<title>aspcool news!</title>
<abstract>test news</abstract>
<author>feiying</author>
<content>
<paragraph>The firet test</paragraph>
</content>
</document>
這個文件是用來顯示新聞的內容
下面給大家看新聞列表顯示的頁面
news
<%@ Import Namespace=
<%@ Page Language=
<%@ Import Namespace=
<%@ Assembly Name=
<%@ Import Namespace=
<%@ Import Namespace=
<html>
<head>
<title>
</title>
<script language=
public string xslt()
{
StringWriter writer = new StringWriter();
//裝入xml對象
XmlDocument xmldoc= new XmlDocument();
xmldoc
//裝入xsl對象
XslTransform xsldoc = new XslTransform();
xsldoc
//把xml轉化成html頁面
DocumentNavigator nav= new DocumentNavigator(xmldoc);
xsldoc
return writer
}
</script>
</head>
<body>
<%=xslt()%>
<p align=
該程序由<a href=
</p>
</body>
</html>
這個頁面完成了從xml通過xslt轉化成html文件
下面是新聞內容顯示的頁面
main
<%@ Import Namespace=
<%@ Page Language=
<%@ Import Namespace=
<%@ Assembly Name=
<%@ Import Namespace=
<%@ Import Namespace=
<html>
<head>
<title>
</title>
<script language=
public string xslt()
{
StringWriter writer = new StringWriter();
XmlDocument xmldoc= new XmlDocument();
xmldoc
XslTransform xsldoc = new XslTransform();
xsldoc
DocumentNavigator nav= new DocumentNavigator(xmldoc);
xsldoc
return writer
}
</script>
</head>
<body>
<%=xslt()%>
<p align=
</body>
</html>
這個功能和上面的一樣
最後
manage
<%@ Import Namespace=
<%@ Import Namespace=
<%@ Assembly Name=
<%@ Import Namespace=
<%@ Page Language=
<%@ Import Namespace=
<HTML>
<HEAD>
<script language=
public void Button
{
//判斷文件是否存在
if(File
{
Response
Response
}
else
{
XmlNode currNode;
XmlDocument xmldoc = new XmlDocument();
xmldoc
string InsStr=
main
XmlDocumentFragment docFrag = xmldoc
docFrag
currNode = xmldoc
currNode
//save the output to a file
xmldoc
//把TextBox
string xmlfile =TextBox
xmlfile = xmlfile
xmlfile = xmlfile
xmlfile = xmlfile
xmlfile = xmlfile
xmlfile = xmlfile
//把數據寫入新建的xml文件中去
XmlDocument doc = new XmlDocument();
doc
<document><title>
TextBox
</content></document>
doc
Response
TextBox
TextBox
TextBox
TextBox
TextBox
}
//向目錄文件中寫數據
}
public void Button
{}
</script>
<meta content=
<meta content=
<meta content=C# name=CODE_LANGUAGE>
</HEAD>
<body MS_POSITIONING=
<form runat=
<FONT face=宋體>
<asp:label id=Label
absolute; TOP:
asp酷技術資訊網網站內容發布系統
</asp:label>
<asp:label id=Label
absolute; TOP:
文件名
</asp:label>
<asp:textbox id=TextBox
absolute; TOP:
</asp:textbox>
<asp:label id=Label
absolute; TOP:
文章名稱
</asp:label>
<asp:textbox id=TextBox
absolute; TOP:
</asp:textbox>
<asp:label id=Label
absolute; TOP:
作者
</asp:label>
<asp:textbox id=TextBox
absolute; TOP:
</asp:textbox>
<asp:label id=Label
absolute; TOP:
摘要
</asp:label>
<asp:textbox id=TextBox
absolute; TOP:
</asp:textbox>
<asp:label id=Label
absolute; TOP:
內容
</asp:label>
<asp:textbox id=TextBox
absolute; TOP:
textmode=
</asp:textbox>
</FONT>
<INPUT id=Button
POSITION: absolute; TOP:
name=Button
<br>
<br>
<div id=mess runat=server>
</div>
<br>
<input type=
runat=
LEFT:
</form>
</body>
</HTML>
此程序在
From:http://tw.wingwit.com/Article/program/net/201311/15780.html