4
I would like to know how to make URL friendly in C# ASP.NET.
I tried to use in the file: global.asax
but it didn’t work.
4
I would like to know how to make URL friendly in C# ASP.NET.
I tried to use in the file: global.asax
but it didn’t work.
4
In fact, it’s not Global.asax
just that you do it. You need to install this package first.
Installed this, you need to put the line below in your Application_Start
:
RouteConfig.RegisterRoutes(RouteTable.Routes);
A file called App_Start/RouteConfig.cs
. Within it, there must be a method in which the following line must exist:
routes.EnableFriendlyUrls();
So if you have a file called Teste.aspx
at the root, with this configuration, Teste.aspx
will be called as /Teste
.
More information? See here.
@Furlan, if you need to, inside the RegisterRoutes(RouteCollection routes)
you can register other routes using the routes.MapPageRoute
, MSDN has several examples regarding: How to: Define Routes for Web Forms Applications
Browser other questions tagged c# asp.net webforms
You are not signed in. Login or sign up in order to post.
Is it for a new application or already exists? It is based on Web Forms or MVC?
– Intruso
@Intruder thank you for responding, the application already exists and is based on Web Forms
– Furlan