使用C#将XML插入特定的div

时间:2011-08-30 15:30:06

标签: c# asp.net xml feedburner

我从feedburner和我的C#代码隐藏中获取XML数据我正在访问这样的数据:

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());

如何将其插入到页面底部已有的div中?

1 个答案:

答案 0 :(得分:1)

设置div runat =“server':

<div id="feedDiv" runat="server"></div>

然后在C#中设置div的InnerHtml或InnerText:

feedDiv.InnerHtml = subscribers[0].Attributes["circulation"].Value.ToString();