<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" Title="Industry News" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Data" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
XmlTextReader reader = new XmlTextReader("http://www.trucknews.com/rssfeeds /TN_dailynews.xml");
DataSet ds = new DataSet();
ds.ReadXml(reader);
GridView1.DataSource = ds.Tables[2];
GridView1.DataBind();
}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<img src="Images/newsweb.gif" /><br />
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" GridLines="None" Width="100%">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table style="width: 100%">
<tr style="text-align: left; vertical-align: text-top">
<td colspan="2"><hr style="width: 100%" /></td>
</tr>
<tr style="text-align: left; vertical-align: text-top">
<td style="text-align: left"><a onclick="window.open(this.href,'_blank');return false;" href="<%# Eval("link") %>"><%# Eval("title") %></a></td>
<td style="text-align: right"><%# Eval("author") %></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle HorizontalAlign="Left" VerticalAlign="Top" />
<AlternatingRowStyle HorizontalAlign="Left" VerticalAlign="Top" />
</asp:GridView>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2040116-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</asp:Content>
任何人都知道问题可能是什么,我需要更多的眼睛=)
我以为这可能是我最近所做的更新,但可惜不是。我认为它与我指向的 XML 有关。
http://www.trucknews.com/rssfeeds/TN_dailynews.xml
预先感谢。