本文整理汇总了C#中System.Web.HttpContext.RemapHandler方法的典型用法代码示例。如果您正苦于以下问题:C# HttpContext.RemapHandler方法的具体用法?C# HttpContext.RemapHandler怎么用?C# HttpContext.RemapHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.HttpContext
的用法示例。
在下文中一共展示了HttpContext.RemapHandler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serve
private void Serve(HttpContext context, IResponseArgs e, MemCacheResult result)
{
context.RemapHandler(new MemCacheHandler(e,result.Data));
}
示例2: TryRemapHandler
private void TryRemapHandler(HttpContext context, IHttpHandler iHttpHandler)
{
try
{
context.RemapHandler(SlickUploadHandlerFactory.GetHandler(context));
}
catch
{
// TODO: error somewhere?
}
}
示例3: Process
public void Process(HttpContext context, IResponseArgs e)
{
CacheResult r = Process(e);
context.Items["FinalCachedFile"] = r.PhysicalPath;
if (r.Data == null) {
//Calculate the virtual path
string virtualPath = VirtualCacheDir.TrimEnd('/') + '/' + r.RelativePath.Replace('\\', '/').TrimStart('/');
//Rewrite to cached, resized image.
context.RewritePath(virtualPath, false);
} else {
//Remap the response args writer to use the existing stream.
((ResponseArgs)e).ResizeImageToStream = delegate(Stream s) {
((MemoryStream)r.Data).WriteTo(s);
};
context.RemapHandler(new NoCacheHandler(e));
}
}
示例4: ShowDebugInfo
private void ShowDebugInfo(HttpContext context, IHttpHandler handler)
{
if( s_IntegratedPipeline == false ) {
handler.ProcessRequest(context);
}
else {
bool isAfterMapRequestHandler = false;
try {
context.RemapHandler(handler);
}
catch( InvalidOperationException ) {
// 在IIS7的集成管线模式下,当前阶段 >= MapRequestHandler 时,会引发这个异常
isAfterMapRequestHandler = true;
}
if( isAfterMapRequestHandler )
handler.ProcessRequest(context);
}
}