Insert XML into a specific div with C#
I am getting XML data from feedburner and in my C# codebehind I am accessing the data like so:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=cooklikecarolyn");
XmlNodeList subscribers = xmlDoc.GetElementsByTagName("entry");
Response.Write(subscribers[0].Attributes["circulation"].Value.ToString());
How do I insert this into a div I already have at the bottom of the page开发者_开发技巧?
Set the div runat="server':
<div id="feedDiv" runat="server"></div>
Then set the InnerHtml or InnerText of the div in C#:
feedDiv.InnerHtml = subscribers[0].Attributes["circulation"].Value.ToString();
精彩评论