title: Set ClientID to static in C#
body: <p>I have a C# code where I am setting the ID of a DIV.</p>
  
  <p>Example:</p>
  
  <pre><code>div.ID = "slider";
  </code></pre>
  
  <p>The only issue is when the website loads ASP adds a whole bunch of random characters in front of the ID. I cannot use the <code>&lt;% Page %&gt;</code> because I am just using a Web Part.</p>
  
  <p>When I tried to set:</p>
  
  <pre><code>div.ClientID = "static";
  </code></pre>
  
  <p>I am given an error where the property is read only.</p>
  
  <p>Is there any other way to set it within C#, so the ID does not change when the website runs my page?</p>
  
  <p>I do not want to use <code>&lt;%= slider.ClientID  %&gt;</code> in the javascript/css code but if that's the only way then I guess I have no choice.</p>