The Results: It was actually easier to code than the toolkit.
How to use:
1. add reference to System.ServiceModel.Web assembly
2. Choose where you want your rss to display. Add a Label and a DataList.
3. Here is the template for the markup
<asp:DataList ID="DataList1" runat="server" Height="445px" Width="215px">
<ItemTemplate>
<asp:HyperLink ID="Hyperlink1" runat="server"
Text='<%# Eval("Title.Text") %>'
Font-Bold="true"
NavigateUrl='<%# Eval("Links[0].Uri.AbsoluteUri") %>'>
</asp:HyperLink>
<br />
<br />
</ItemTemplate>
</asp:DataList>4. Place the following in the Page_Load
<ItemTemplate>
<asp:HyperLink ID="Hyperlink1" runat="server"
Text='<%# Eval("Title.Text") %>'
Font-Bold="true"
NavigateUrl='<%# Eval("Links[0].Uri.AbsoluteUri") %>'>
</asp:HyperLink>
<br />
<br />
</ItemTemplate>
</asp:DataList>4. Place the following in the Page_Load
32 XmlReader reader = XmlReader.Create
33 ("http://URLofYourBlog");
34
35 Rss20FeedFormatter formatter =
36 new Rss20FeedFormatter();
37 formatter.ReadFrom(reader);
38 reader.Close();
39
40 DataList1.DataSource = formatter.Feed.Items;
41 DataList1.DataBind();
5. I was getting a Dtd security error and fixed it by adding
27 XmlReaderSettings settings = new XmlReaderSettings();
28 settings.ProhibitDtd = false;
To the beginning of the event holder.
6. Good luck debugging for your specific project!!
No comments:
Post a Comment