title: A potentially dangerous Request.Path value was detected from the client (&)
body: <p>I understand why this is happening but I need a work-around. I looked into some other questions on StackOverflow but none of them was helpful. I do not want disable input validation throughout the whole website because that is definitely dangerous. I have only one (at least for now) place where I need to disable input validation. </p>
  
  <p>I decorated the Action Method with [ValidateInput(false)] attribute, and I'm encoding the strings with Html.Encode. But still, I get the same error. Here's my view:</p>
  
  <pre><code>&lt;div id="sharwe-categories"&gt;
      &lt;ul class="menu menu-vertical menu-accordion"&gt;
          @foreach(var topLevel in Model)
          {
              var topLevelName = Html.Encode(topLevel.Name);
               &lt;li class="topLevel"&gt;
                  &lt;h3&gt;  
                      @Html.ActionLink(topLevel.Name, "Index", "Item", new { category = topLevelName }, new {@class = "main"} )
                      &lt;a href="#" class="drop-down"&gt;&lt;/a&gt;
                  &lt;/h3&gt;
                  &lt;ul&gt;
                      @foreach (var childCategory in topLevel.Children)
                      {
                          var childcategoryName = Html.Encode(childCategory.Name);
                          &lt;li&gt;@Html.ActionLink(childCategory.Name, "Index", "Item", new RouteValueDictionary { { "category", topLevelName }, { "subcategory", childcategoryName } }, null)&lt;/li&gt;
                      }
                  &lt;/ul&gt;
              &lt;/li&gt;
          }
  
      &lt;/ul&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>As you can see, there's no user input. But some of the category names have some "dangerous" characters in them... Any solutions?</p>