title: ASP.NET: How do I access a property of my UserControl, from within JScript?
body: <p>I need read-access to a user-defined property of my UserControl, from within a <code>&lt;script&gt;</code> element. This script needs to run when the user clicks on the link (which I also don't know how to setup). Thanks for your advice, SO!  </p>
  
  <p><b>Code-behind:</b></p>
  
  <pre><code>public partial class TNLink : System.Web.UI.UserControl
  {
      [System.ComponentModel.BindableAttribute(true)]
      public virtual string TNImageURL { get; set; }
  
      [System.ComponentModel.BindableAttribute(true)]
      public virtual string FullImageURL { get; set; }
  
      [System.ComponentModel.BindableAttribute(true)]
      public virtual string Caption { get; set; }
  }
  </code></pre>
  
  <p><b>ASP:</b></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      //****How do I access the FullImageURL property for this line?****
      document.getElementById('imgFull').src = FullImageURL;
  &lt;/script&gt;
  &lt;div style="text-align: center"&gt;
      &lt;a&gt;
          &lt;asp:Image ID="imgTN" runat="server"
              ImageUrl='&lt;%# DataBinder.Eval (Page, "TNImageURL") %&gt;'
              style="border: 5px solid #000000; width: 85%;" /&gt;&lt;br /&gt;
          &lt;asp:Label ID="lblCaption" runat="server"
              Text='&lt;%# DataBinder.Eval (Page, "Caption") %&gt;' /&gt;
      &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>