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.
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.
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 .