asp:Button is not calling server-side function
<p>I'm instantiating an asp:Button inside a data-bound asp:GridView through template fields. Some of the buttons are supposed to call a server-side function, but for some weird reason, it doesn't. All the buttons do when you click them is fire a postback to the current page, doing nothing, effectively just reloading the page.</p>

<p>Below is a fragment of the code:</p>

<pre><code>&lt;asp:GridView ID="gv" runat="server" AutoGenerateColumns="false" CssClass="l2 submissions" ShowHeader="false"&gt;
    &lt;Columns&gt;      

        &lt;asp:TemplateField&gt;            
            &lt;ItemTemplate&gt;&lt;asp:Panel ID="swatchpanel" CssClass='&lt;%# Bind("status") %&gt;' runat="server"&gt;&lt;/asp:Panel&gt;&lt;/ItemTemplate&gt;                
            &lt;ItemStyle Width="50px" CssClass="sw" /&gt;
        &lt;/asp:TemplateField&gt;

        &lt;asp:BoundField DataField="description" ReadOnly="true"&gt;                                
        &lt;/asp:BoundField&gt;

        &lt;asp:BoundField DataField="owner" ReadOnly="true"&gt;
            &lt;ItemStyle Font-Italic="true" /&gt;
        &lt;/asp:BoundField&gt;

        &lt;asp:BoundField DataField="last-modified" ReadOnly="true"&gt;
            &lt;ItemStyle Width="100px" /&gt;
        &lt;/asp:BoundField&gt;

        &lt;asp:TemplateField&gt;
            &lt;ItemTemplate&gt;
                &lt;asp:Button ID="viewBtn" cssclass='&lt;%# Bind("sid") %&gt;' runat="server" Text="View" OnClick="viewBtnClick" /&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:TemplateField&gt;                                         

    &lt;/Columns&gt;
&lt;/asp:GridView&gt;
</code></pre>

<p>The viewBtn above should call the viewBtnClick() function on server-side. I do have that function defined, along with a proper signature (object,EventArgs). One thing that may be of note is that this code is actually inside an ASCX, which is loaded in another ASCX, finally loaded into an ASPX.</p>

<p>Any help or insight into the matter will be SO appreciated. Thanks!</p>

<p>(oh, and please don't mind my trashy HTML/CSS semantics - this is still in a very,very early stage :p)</p>
