Registering a script multiple times
<p>In the code behind, I register a startup script as below:</p>

<pre><code>  string strFunctionName = "ShouldAdd";
  sb.Append(strFunctionName + @"((blnShouldAdd ? "true" : "false") + ", true);");

  ScriptManager.RegisterStartupScript(this, this.GetType(), "shouldAdd", sb.ToString(), true);
</code></pre>

<p>This piece of code is called twice, once in Page Load when <code>blnShouldAdd</code> evaluates to <code>false</code> and in the event handler of a button when <code>blnShouldAdd</code> evaluates to <code>true</code>.</p>

<p>Strangely, when I debug the code and step into the ShouldAdd JS function, the value is always false. I would assume it to be true as the second call in the event handler overrides the first one.</p>

<p>Any ideas?</p>
