Page Event 'onClick' causes error
<pre><code>&lt;asp:Button ID="btnConnect" runat="server" Text="Connect" OnClick="btnConnect_Click"/&gt;

Protected Sub btnConnect_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnConnect.Click
    con.Open()
    MsgBox("Hi..")
End Sub
</code></pre>

<p>The above code shows an error whilst running the page.</p>

<blockquote>
  <p>Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.<br/>
  Compiler Error Message: BC30456: 'btnConnect_Click' is not a member of 'ASP.register_page_aspx' &lt;asp:Button ID="btnConnect" runat="server" Text="Connect" OnClick="btnConnect_Click"/&gt;</p>
</blockquote>

<p>How can this issue be resolved?</p>