Url friendly in ASP.NET Web Forms

Asked

Viewed 829 times

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.

  • Is it for a new application or already exists? It is based on Web Forms or MVC?

  • @Intruder thank you for responding, the application already exists and is based on Web Forms

1 answer

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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.