This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 22nd, 2012  |  syntax: None  |  size: 1.09 KB  |  views: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. HttpContext.Current.Response.AppendHeader("P3P", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
  2.        
  3. public static void RegisterRoutes(RouteCollection routes)
  4. {
  5.   HttpContext.Current.Response.AppendHeader("P3P", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
  6.   routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  7.   routes.MapRoute(
  8.       "Default", // Route name
  9.       "{controller}/{action}/{id}", // URL with parameters
  10.       new { controller = "Account", action = "Logon", id = UrlParameter.Optional }
  11.   );
  12.  
  13. }
  14.        
  15. <system.webServer>
  16.     <httpProtocol>
  17.       <customHeaders>
  18.         <add name="P3P" value='CP="CAO PSA OUR"'/>
  19.        
  20. public class P3PHeaderAttribute : ActionFilterAttribute
  21. {
  22.     public override void OnActionExecuted(ActionExecutedContext filterContext)
  23.     {
  24.         filterContext.HttpContext.Response.AppendHeader("P3P", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
  25.  
  26.     }
  27. }
  28.        
  29. public static void RegisterGlobalFilters(GlobalFilterCollection filters)
  30.     {
  31.         filters.Add(new P3PHeaderAttribute());
  32.     }
clone this paste RAW Paste Data