title: ScriptManager is inaccessible
body: <p>I am trying to invoke the js function implemented on the aspx page from a .cs class. But, ScriptManager doesn't seem to exist in .cs class. Basically, the .cs file is a part of dll that I am using in my project. I need to invoke the js function that is implemented on the aspx page, from my .cs file present in the dll.</p>
  
  <p>The js function is successfuly invoked from the aspx page, but when I try the same code in .cs file it says </p>
  
  <blockquote>
    <p>ScriptManager is inaccessible due to its protection level.</p>
  </blockquote>
  
  <p>here is code I am trying</p>
  
  <pre><code>protected void MyMethod()
  {
     ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "jsfunction();", true);
  }
  </code></pre>
  
  <p>any ideas why the same code runs successfuly on the aspx page but not from a .cs class?</p>