ASP.NET programming supports the creation of custom HttpHandler
components, which provide a flexible and efficient way to process
requests that don't return standard HTML-based pages. For example,
HttpHandler components are great for situations in which you want to
return simple text, XML, or binary data to the user.
<%@ Assembly Name="Microsoft.SharePoint, [full assembly name]" %> <%@ WebHandler Language="C#" Class="HelloHttpHandler" %> using System; using System.Web; using Microsoft.SharePoint; public class HelloHttpHandler : IHttpHandler { public bool IsReusable { get { return false; } } public void ProcessRequest(HttpContext context) { SPSite siteColl = SPContext.Current.Site; SPWeb site = SPContext.Current.Web; context.Response.ContentType = "text/plain" context.Response.Write("Hello HttpHandler from the site " + site.Title + " at " + site.Url); } }
No comments:
Post a Comment
Thank you for Commenting Will reply soon ......