Registering javascipt with ScriptManager is working inconsistently
<p>I'm developing an ASP.NET page. Currently there is no AJAX on the page. in the code behind for different button click events, I am registering the script below. The purpose of the script is to scroll the window to a particular anchor tag. The method is as follows:</p>

<pre><code>public void RegisterAnchor(string anchorTag)
{
    Page.ClientScript.RegisterStartupScript(Page.GetType(), "navigate",
          "window.onload = function() {window.location.hash='#" + anchorTag + "';}", true);
}
</code></pre>

<p>I have two different anchor tags are that valid and defined in the same way.  However, one is working and one is not.
What can I check to identify the cause of this behavior?  </p>

<p>Anchor tag in ascx:</p>

<pre><code>&lt;a name="EditDlg"&gt;&lt;/a&gt;     
</code></pre>
