<
script runat
=
"
server
"
>
protected
void
Page_Load(
object
sender, EventArgs e) { System.Xml.XmlDocument doc
=
new
System.Xml.XmlDocument(); doc.Load(
"
http://dotnet.aspx.cc/Rss.aspx
"
); XmlDataSourceX.Data
=
doc.InnerXml; XmlDataSourceX.XPath
=
"
/rss/channel/item
"
; }
</
script
>
<
asp:GridView
ID
="GridViewX"
runat
="server"
DataSourceID
="XmlDataSourceX"
AutoGenerateColumns
="False"
>
<
Columns
>
<
asp:TemplateField
HeaderText
="文章标题"
>
<
ItemTemplate
>
<
asp:HyperLink
ID
="HyperLink1"
runat
="server"
NavigateUrl
='<%#
XPath("link") %
>
' Target="_blank">
<%
# XPath(
"
title
"
)
%>
>
</
asp:HyperLink
>
[
<%
# (DateTime.Parse(XPath(
"
pubDate
"
).ToString().Replace(
"
GMT
"
,
""
))).ToString(
"
yyyy年M月d日
"
)
%>
]
</
ItemTemplate
>
</
asp:TemplateField
>
</
Columns
>
</
asp:GridView
>
<
asp:XmlDataSource
ID
="XmlDataSourceX"
runat
="server"
></
asp:XmlDataSource
>
转载请注明原文地址: https://ibbs.8miu.com/read-900078.html