title: Im having problems trying to URL encode a databinder result
body: <p>I am using a repeater to show a list of strings- I am having issues trying to url encode the links (replace the spaces with %20 etc.)
  I initially wrote a small method:</p>
  
  <pre><code>public string encodePath(string path)
  {
      string newPath = HttpUtility.UrlEncode(path);
      return newPath;
  }
  </code></pre>
  
  <p>and then tried </p>
  
  <pre><code>&lt;%# encodePath(Eval(Container.DataItem, "Area"))%&gt;
  </code></pre>
  
  <p>but I am getting a compilation error "CS1502: The best overloaded method match for 'System.Web.UI.TemplateControl.Eval(string, string)' has some invalid arguments"</p>
  
  <p>I also tried to just use the util without the method</p>
  
  <pre><code>HttpUtility.UrlEncode(DataBinder.Eval(Container.DataItem, "Area"))
  </code></pre>
  
  <p>As I believe it will be faster - but also got an error...</p>