C# Class Unic.SitecoreCMS.Modules.ErrorManager.Resources.Media.MediaRequestHandler

Class implements a custom MediaRequestHandler. It redirects to the configured 404 page if a media request is invalid.

To add the handler, change the default MediaRequestHandler in web.config from: <system.webServer> <handlers> <add verb="*" path="sitecore_media.ashx" type="Sitecore.Resources.Media.MediaRequestHandler, Sitecore.Kernel" name="Sitecore.MediaRequestHandler" /> </handlers> </system.webServer> to <system.webServer> <handlers> <add verb="*" path="sitecore_media.ashx" type="Unic.SitecoreCMS.Modules.ErrorManager.Resources.Media.MediaRequestHandler, Unic.SitecoreCMS.Modules.ErrorManager" name="Sitecore.MediaRequestHandler" /> </handlers> </system.webServer> and from <system.web> <httpHandlers> <add verb="*" path="sitecore_media.ashx" type="Sitecore.Resources.Media.MediaRequestHandler, Sitecore.Kernel" /> </httpHandlers> </system.web> to <system.web> <httpHandlers> <add verb="*" path="sitecore_media.ashx" type="Unic.SitecoreCMS.Modules.ErrorManager.Resources.Media.MediaRequestHandler, Unic.SitecoreCMS.Modules.ErrorManager" /> </httpHandlers> </system.web>
Inheritance: Sitecore.Resources.Media.MediaRequestHandler
显示文件 Open project: unic/SitecoreErrorManager

Protected Methods

Method Description
DoProcessRequest ( HttpContext context ) : bool

Process the current request and return false if the media item was not found, so Sitecore can go ahead with processing the pipelines. Also check the availableLanguages from the current Sitecore.Sites.SiteContext to check for a valid language version of the media.

Method Details

DoProcessRequest() protected method

Process the current request and return false if the media item was not found, so Sitecore can go ahead with processing the pipelines. Also check the availableLanguages from the current Sitecore.Sites.SiteContext to check for a valid language version of the media.
protected DoProcessRequest ( HttpContext context ) : bool
context System.Web.HttpContext Current .
return bool