title: Create Property in ASP.Net Control to C# and ASPX
body: <p>I am trying to create a custom property in a extended control, so that it can be acessed in both ASPX and C#.
  The problem wasn't actually creating it... because i managed to do it, by applying the following code:</p>
  
  <pre><code>public static class Icon
  {
      public static string activityMonitor = "activityMonitor.png";
      public static string addBlankPage = "addBlankPage.png";
      public static string addComment = "addComment.png";
      public static string addPageTable = "addPageTable.png";
  }
  
  
  public class myButtonIcon : LinkButton
  {
      public myButtonIcon()
      {
      }
  
      [Bindable(false)]
      [Category("Properties")]
      [DefaultValue("")]
      [Localizable(true)]
  
      public string IconName { get; set; }
  }
  </code></pre>
  
  <p>However I am sure that this is not the correct way of doing this... for many reasons :(</p>
  
  <p><strong>For example:</strong></p>
  
  <p>I can do: btnIcon.IconName = Icon. //and the names will appear here
  but they will not appear if I do:</p>
  
  <pre><code>&lt;myControl:myButtonIcon ID="btnTest" runat="server" IconName=" //names do not appear here&gt;&lt;/myControl:myButtonIcon&gt;
  </code></pre>
  
  <p>And I am also using two properties instead of using only one... but I tried to combine them in to a single one... but i didn't sucess... so only IconName2 appears in the ASPX.</p>
  
  <p>So... I would really appreciate if you could explain me this better.
  The code you see here was the result of a long research on the internet and a lot of tries. :(</p>