Telerik.Web.Mvc.SiteMapHandler.ProcessRequest C# (CSharp) Method

ProcessRequest() public method

Processes the request.
public ProcessRequest ( System.Web.HttpContextBase context ) : void
context System.Web.HttpContextBase The context.
return void
        public override void ProcessRequest(HttpContextBase context)
        {
            string name = context.Request.QueryString["name"];
            SiteMapBase siteMap = GetSiteMap(name);

            if ((siteMap != null) && siteMap.GenerateSearchEngineMap)
            {
                HttpResponseBase response = context.Response;

                // Set the content type
                response.ContentType = "text/xml";

                // Compress
                if (siteMap.Compress)
                {
                    httpResponseCompressor.Compress(context);
                }

                // Write
                using (StreamWriter sw = new StreamWriter(response.OutputStream, Encoding.UTF8))
                {
                    using (XmlWriter xtw = XmlWriter.Create(sw, new XmlWriterSettings { Indent = false, Encoding = Encoding.UTF8 }))
                    {
                        WriteSiteMap(xtw, siteMap, context);
                    }
                }

                // Cache
                httpResponseCacher.Cache(context, TimeSpan.FromMinutes(siteMap.CacheDurationInMinutes));
            }
        }