Friendly Url in ASP.NET Web Forms

3

I would like to know how to make friendly URL in C # ASP.NET.

I tried to use the file: global.asax but it did not work.

    
asked by anonymous 01.07.2016 / 21:08

1 answer

4

In fact, it is not by Global.asax only that this is done. You must install this package first .

Installed this, you need to put the line below in your Application_Start :

RouteConfig.RegisterRoutes(RouteTable.Routes);

A file named App_Start/RouteConfig.cs must be created. Within it, there should be a method where the following line should exist:

routes.EnableFriendlyUrls();

So if you have a file named Teste.aspx in the root, with this setting, Teste.aspx will be called as /Teste .

More information? See here .

    
01.07.2016 / 21:29