ASP.NET Call Another Element's DoPostBack Function
<p>I have an ASP.NET control that has an onclick event handler rendered inline on the element.  I would like to call that function and have it raise the target control's server side event handler.</p>

<pre><code>&lt;asp:CheckBox ID="Foo" 
    runat="server" 
    AutoPostBack="true" 
    Text="Foo" /&gt;

&lt;a href="#" 
    onclick="javascript:setTimeout('__doPostBack(\'Foo\',\'\')', 0)"&gt;Test
&lt;/a&gt;
</code></pre>

<p>I created the checkbox, looked at the rendered function on the field, and then copied that into the onclick on the anchor element.</p>

<p>The anchor will raise a postback, but the event handler for the check box is not raised.</p>

<pre><code>protected override void OnLoad(EventArgs e)
{
    // fires for checkbox
    // fires for anchor (the anchor does cause a postback)
}

void Foo_CheckedChanged(object sender, EventArgs e)
{
    // fires for checkbox
    // does not fire for anchor
}

protected override void OnInit(EventArgs e)
{
    this.Foo.CheckedChanged += new EventHandler(Foo_CheckedChanged);
}
</code></pre>

<p>Is it possible to do this?</p>
