Created
March 19, 2013 02:34
-
-
Save pdwetz/5193287 to your computer and use it in GitHub Desktop.
UrlFor() doesn't seem to be encoding forward slashes ("/") properly. The result of the following is "/alpha/1/abc/def%26ghi%3Djkl", but should have the forward slash encoded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AlphaController | |
{ | |
private readonly UrlRegistry _urlregistry; | |
public AlphaController(UrlRegistry urlreg) | |
{ | |
_urlregistry = urlreg; | |
} | |
public string Get_Alpha_Id_Name(AlphaInputModel input) | |
{ | |
return string.Format("Input: {0}", input.Name); | |
} | |
public string Get_Alpha() | |
{ | |
return _urlregistry.UrlFor(new AlphaInputModel { Id = 1, Name = "abc/def&ghi=jkl" }); | |
} | |
} | |
public class AlphaInputModel | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment