26-5-2008 22:3:31
Còn đây là mẫu code làm con RSS
------------
RSSHandler.cs
namespace KBMentor2
{
using System;
using System.IO;
using System.Web;
public class RSSHandler : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/xml";
context.Response.ContentEncoding = System.Text.Encoding.UTF8;
string sXml = BuildXMLString(); //not showing this function,
//but it creates the XML string
context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(600));
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Write( sXml );
}
public bool IsReusable
{
get { return true; }
}
}
}