Am trying to displayfeed on my own site by inserting the url into database then display it use web feed. I have some code below
<!-- Webfeed -->
<div class="webfeed" style=" margin-left: 12px">
<div class=" " style="">
<div class="media-list " style="">
<div class="media">
<asp:Panel ID="hidWebfeed" runat="server">
<div class="well-md" style=" margin-top:2px; margin-bottom:6px; font-variant-caps:titling-caps">
<div class="media-body " style="margin-top:2px; background-color:transparent">
<div class="" style="margin-top:2px">
<asp:Label ID="Label22" runat="server" CssClass="glyphicon glyphicon-share-alt " ForeColor="#99CC00" Font-Size="Small" Font-Bold="False"></asp:Label><span style="margin-right:3px"></span><asp:Label ID="Label58" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"Name") %>' ForeColor="#99CCFF" Font-Bold="False"/>
<div class="clearfix" ></div>
</div>
<div class="" style=" ">
<div class=" " style="">
<div class="clearfix">
</div>
</div>
</div>
</div>
</div>
</asp:Panel>
<asp:LinkButton ID="LinkButton9" runat="server" Visible="True">
<div class=" " style="margin-bottom:8px; width:97%">
<asp:Image ID="Image3" Text='<%#Eval("ImageName")%>' runat="server" class="imageshared " Width="100%" alt="" ImageUrl='<%# ("../UserImage/") %>'/>
<asp:Panel ID="Panel7" runat="server">
<div class=" panel-footer" style=" border: 1px solid #EBEBEB; background-color:transparent">
<h3 style="color:#3E7CFF"><%#Eval("Title") %></h3>
<asp:Label ID="Label62" runat="server" Text='<%#Eval("Name") %>' Font-Bold="True " ForeColor="#999999" Font-Size="" />
<div class="" style=" margin-top:2px"></div>
<a href='<%#Eval("Link") %>' target="_blank">Read More...</a>
</div>
</asp:Panel>
</div>
</asp:LinkButton></div>
</div>
</div>
//</div>
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
public partial class GridviewEditUpdate : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string connectionString = "Data Source=MYCBJ017550027;Initial Catalog=MySamplesDB;Integrated Security=True";
DataTable dt = new DataTable();
SqlConnection conn = new SqlConnection(connectionString);
using (conn)
{
SqlDataAdapter ad = new SqlDataAdapter("SELECT * from tblRSS", conn);
ad.Fill(dt);
}
Response.Clear();
Response.ContentType = "text/xml";
XmlTextWriter TextWriter = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
TextWriter.WriteStartDocument();
//Below tags are mandatory rss
TextWriter.WriteStartElement("rss");
TextWriter.WriteAttributeString("version", "2.0");
// Channel tag will contain RSS feed details
TextWriter.WriteStartElement("channel");
TextWriter.WriteElementString("title", "C#.NET,ASP.NET Samples and Tutorials");
TextWriter.WriteElementString("link", "http://aspdotnet-suresh.blogspot.com");
TextWriter.WriteElementString("description", "Free ASP.NET articles,C#.NET,ASP.NET tutorials and Examples,Ajax,SQL Server,Javascript,XML,GridView Articles and code examples -- by Suresh Dasari");
TextWriter.WriteElementString("copyright", "Copyright 2009 - 2010 aspdontnet-suresh.blogspot.com. All rights reserved.");
foreach (DataRow oFeedItem in dt.Rows)
{
TextWriter.WriteStartElement("item");
TextWriter.WriteElementString("title", oFeedItem["Title"].ToString());
TextWriter.WriteElementString("description", oFeedItem["Description"].ToString());
TextWriter.WriteElementString("link", oFeedItem["URL"].ToString());
TextWriter.WriteEndElement();
}
TextWriter.WriteEndElement();
TextWriter.WriteEndElement();
TextWriter.WriteEndDocument();
TextWriter.Flush();
TextWriter.Close();
Response.End();
}
}
here is were i saw the few code am using to do that
http://www.aspdotnet-suresh.com/2010/04/creating-rss-feed-using-aspnet-with-c.html