Sometimes you have files with unexpected characters - like umlauts or spaces. The best way to encode this is using Tags.SafeUrl(...)
from RazorBlade, or Uri.EscapeUriString(...)
from .net.
Important notes
- Two characters won't resolve properly on a standard web server:
+
and %
. There are ways to work around this, but we would avoid them at all cost.
- Other characters like
spaces
, umlauts (öäè
) etc. are no problem.
- You may also find suggestions to use
Server.UrlEcode(...)
. This often doesn't work!
- Remember to add
@@using System
to make this fly