I am passing a return URL to an administrator, but I am not using an MVC assistant ie the applicationlink. Should I use Server.UrlEncode before I redirect from the Administrator with this URL? Do not seem to work properly.
UrlEncode will replace invalid url characters with their escape code. Then the entire URL should not be saved.
Here is a sample use:
string my URL = "http://www.contoso.com/articles.aspx?title=" + Server.UrlEncode (" ASP .NET Example "); Response.Write ("& lt; a href =" + MyURL + "& gt; ASP.NET example & lt; / a & gt;);
This output will be Http://www.contoso.com/articles.aspx?title=ASP.NET+Examples
Comments
Post a Comment