Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting the last part of URL
Message
 
 
General information
Forum:
ASP.NET
Category:
MVC
Environment versions
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01659359
Message ID:
01659383
Views:
24
>Since you don't give an example uri and since there can be an unknown number of segments and you also don't explain which bit you want then it's not possible to answer this.
>But .Segments is an array of strings and if, for example, you wanted the next to last then :
Request.Url.Segments[Request.Url.Segments.Length-2]
Thanks, Viv. I wanted the very last segment and I just solved it using Path.GetFileName instead.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform