Darkminded Posted August 28, 2012 Posted August 28, 2012 (edited) Hi everyone, I am new to ASP.NET and would like some assistance. I'm trying to call an XML tag from a rss feed found online. the tag reads:<dc:subject>5</dc:subject> However, the compiler throws and error when running. Please help. The code is as follows: <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <!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>Untitled Page</title> </head> <body> <form id="frmListViewExample" runat="server"> <asp:ListView ID="lvExample" runat="server" DataSourceID="XmlDataSource1"> <AlternatingItemTemplate> Title: <%#XPath("title")%><br /> Published Date: <%#XPath("pubDate")%><br /> Link: <%#XPath("link")%><br /> Description: <%#XPath("description")%> </AlternatingItemTemplate> <LayoutTemplate> <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder> </LayoutTemplate> <EmptyDataTemplate> No data was returned. </EmptyDataTemplate> <ItemTemplate> Title: <%#XPath("title")%><br /> Published Date: <%#XPath("pubDate")%><br /> Link: <%#XPath("link")%><br /> Description: <%#XPath("description")%><br /> </ItemTemplate> <ItemSeparatorTemplate> <hr> </ItemSeparatorTemplate> </asp:ListView> <asp:DataPager ID="DataPager1" runat="server" PagedControlID="lvExample" PageSize="1"> <Fields> <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" /> <asp:NumericPagerField /> <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" /> </Fields> </asp:DataPager> <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="http://earthquake.usgs.gov/earthquakes/shakemap/rss.xml" XPath="rss/channel/item"></asp:XmlDataSource> </form> </body> </html> Edited August 29, 2012 by PlausiblyDamp Quote
Administrators PlausiblyDamp Posted August 29, 2012 Administrators Posted August 29, 2012 Which line is throwing the error? What is the error that is being thrown? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.