I'm learning ASP.NET 4.5 and stumbled upon this post about Friendly URLs. Now I'm using ASP.NET 4.5 and it turns out the feature was already enabled and installed when I create a new ASP.NET project.
Let's say I have the following URL:
This should map to the following:
This works fine inside of Users.aspx.cs
, but can I use it in Global.asax
as well? I've tried it and the following methods return empty strings:
string a = Request.GetFriendlyUrlFileExtension();
string b = Request.GetFriendlyUrlFileVirtualPath();
IList<string> c = Request.GetFriendlyUrlSegments();