Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created August 12, 2021 15:42
Show Gist options
  • Save bjoerntx/7b17c28f7e737cedb5d6dfd4264988eb to your computer and use it in GitHub Desktop.
Save bjoerntx/7b17c28f7e737cedb5d6dfd4264988eb to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Microsoft.AspNet.FriendlyUrls;
namespace webforms_js_viewer
{
public static class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
var settings = new FriendlyUrlSettings();
settings.AutoRedirectMode = RedirectMode.Permanent;
routes.EnableFriendlyUrls(settings);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment