Html.ActionLink is not rendering # as expected
When using Html.ActionLink passing in a string containing # char it looks like it is, but if you UrlEncode it appears as% 2523.
I believe this is a mistake. Beta version of MVC.
Is this really a mistake?
http://example.com/test# appears as
http://example.com/test%2523 instead of
+1
Paulo
source
to share
5 answers
Yes, yes, run the following console application and see what it outputs:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string hash = "#";
Console.WriteLine(HttpUtility.UrlEncode(hash));
}
}
}
+1
source to share