csharp 来自http://www.codemag.com/Article/1312081

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 来自http://www.codemag.com/Article/1312081相关的知识,希望对你有一定的参考价值。

public class ErrorModule : ApplicationErrorModule
{
      
    protected override void OnDisplayError(
                               WebErrorHandler errorHandler,
                               ErrorViewModel model)
    {
        var response = HttpContext.Current.Response;
      
        // Create an arbitrary controller instance
        var controller =
            ViewRenderer.CreateController<GenericController>();
            
        string html = ViewRenderer.RenderPartialView(
                                    "~/views/shared/Error.cshtml",
                                    model,
                                    controller.ControllerContext);
      
        HttpContext.Current.Server.ClearError();
        response.TrySkipIisCustomErrors = true;
        response.ClearContent();
      
        response.StatusCode = 500;
        response.Write(html);
    }
}
      
// *any* controller class will do for the template
public class GenericController : Controller
{ }

以上是关于csharp 来自http://www.codemag.com/Article/1312081的主要内容,如果未能解决你的问题,请参考以下文章

csharp 来自csvj的getFrameworkVersion在tfvc上

csharp 来自http://www.codemag.com/Article/1312081

csharp 来自http://www.codemag.com/Article/1312081

csharp 来自http://www.codemag.com/Article/1312081

csharp 来自http://www.codemag.com/Article/1312081

csharp HMACSHA256来自http://ideone.com/JdpeL