title: Get current page URL without query parameters - Razor Html helper?
body: <p>Is there a method in Razor that returns the current pages URL without the query parameters.</p>
  
  <p>I need to shove it into an HTML helper method I have created as a string.</p>
  
  <p><code>@Url</code> does not seem to work and if I do <code>.ToString()</code> I just get the namespace LOLLL</p>
  
  <p><strong>Razor use:</strong></p>
  
  <pre><code>&lt;th width="100%" @Html.SortTableClickEvent(@Url.ToString(), "Name")&gt;
  </code></pre>
  
  <p><strong>Html helper:</strong></p>
  
  <pre><code>    public static MvcHtmlString SortTableClickEvent(this HtmlHelper html, string url, string column)
      {
          StringBuilder sortingPropertiesObject = new StringBuilder();
          sortingPropertiesObject.Append("var properties = new James.prototype.Table.SortingProperties();");
          sortingPropertiesObject.Append("properties.url = \"" + url + "\"");
          sortingPropertiesObject.Append("properties.colName = \"" + column + "\"");
  
          string clickEvent = "onclick = James.Table.SortByColumn(properties, this);";
  
          return MvcHtmlString.Create(sortingPropertiesObject + clickEvent);
      }
  </code></pre>
  
  <p><strong>What gets output to my html:</strong></p>
  
  <pre><code>&lt;th width="100%" onclick='James.Table.SortByColumn("Name",' this);="" properties.colname="Name" james.prototype.table.sortingproperties();properties.url="System.Web.Mvc.UrlHelper" properties="new" var=""&gt;
              Name
          &lt;/th&gt;
  </code></pre>