<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!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>RSS Web Service</title>
<script type="text/javascript">
// This function calls the Web Service method.
function GetRSSFeed()
{
var strRSSUrl = document.getElementById("RSSUrl");
RSSReader.RssService.GetRSSFeed(strRSSUrl.value, SucceededRSSCallback);
}
// This is the callback function that
// processes the Web Service return value.
function SucceededRSSCallback(result)
{
var RssResults = '';
var RsltElem = document.getElementById("Results");
var myObject = eval(result);
var Title;
var RssDescription;
var RssLink;
for ( var i=0, len=myObject.length; i<len; ++i )
{
Title = myObject[i].Title;
RssDescription = myObject[i].Description;
RssLink = "<a id='lnk" + i + "' href='" + myObject[i].Link + "' >" + myObject[i].Link + "</a>";
RssResults += '<h4>' + Title + '</h4>' + RssDescription + '<br />' + RssLink + '<br /><br />' ;
}
RsltElem.innerHTML = RssResults;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="RssService.asmx"></asp:ServiceReference>
</Services>
</asp:ScriptManager>
<br />
<asp:HyperLink ID="lnkWebService" runat="server" NavigateUrl="~/RssService.asmx"
Font-Size="16pt">RSS Web Service</asp:HyperLink></div>
<div>
<br />
<input id="RSSUrl" size="100" type="text" value="http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml" /><br />
<br />
<input id="RssButton" type="button" value="Get RSS" onclick="GetRSSFeed()" />
<br />
<br />
<hr />
</div>
<div>
<span id="Results"></span>
</div>
</form>
</body>
</html>