PageRenderTime 37ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/CSASPNETMVCCustomActionFilter/Global.asax.cs

#
C# | 57 lines | 25 code | 9 blank | 23 comment | 0 complexity | 0d6c285c0ec3fd83b8b12076769f64ed MD5 | raw file
  1. /****************************** Module Header ******************************\
  2. * Module Name: MessageModifierActionFilter.cs
  3. * Project: CSASPNETMVCCustomActionFilter
  4. * Copyright (c) Microsoft Corporation.
  5. *
  6. * The CSASPNETMVCCustomActionFilter sample demonstrates how to use C# codes to
  7. * create custom ActionFilters for ASP.NET MVC web application. In this sample,
  8. * there are two custom ActionFilters, one is used for customizing ViewData
  9. * before page view result get executed and rendered; another is used for
  10. * perform logging within the various events during the processing of custom
  11. * ActionFilters.
  12. *
  13. *
  14. * This source is subject to the Microsoft Public License.
  15. * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
  16. * All other rights reserved.
  17. *
  18. * History:
  19. * * 10/10/2009 1:35 PM Steven Cheng Created
  20. ***************************************************************************/
  21. using System;
  22. using System.Collections.Generic;
  23. using System.Linq;
  24. using System.Web;
  25. using System.Web.Mvc;
  26. using System.Web.Routing;
  27. namespace CSASPNETMVCCustomActionFilter
  28. {
  29. // Note: For instructions on enabling IIS6 or IIS7 classic mode,
  30. // visit http://go.microsoft.com/?LinkId=9394801
  31. public class MvcApplication : System.Web.HttpApplication
  32. {
  33. public static void RegisterRoutes(RouteCollection routes)
  34. {
  35. // Default code for registering MVC Url routering rules
  36. routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  37. routes.MapRoute(
  38. "Default", // Route name
  39. "{controller}/{action}/{id}", // URL with parameters
  40. new { controller = "Home", action = "Index", id = "" } // Parameter defaults
  41. );
  42. }
  43. protected void Application_Start()
  44. {
  45. RegisterRoutes(RouteTable.Routes);
  46. }
  47. }
  48. }