You are getting that error because the compiler can't locate or find the
CloseDialogToTest
event. The
OnClick
event an ASP.NET
Button
Control
is a Server
event. That means, when you declare your markup like this:
<asp:Button runat="server" id="btnTest" Text="Log In" OnClick="btnTest_Click" />
The matching event handler in your C# code would look something like this:
protected void btnTest_Click(object sender, EventArgs e)
{
}
If you are trying to call a
JavaScript
function then use the
OnClientClick
event of the Button instead like this:
<asp:Button runat="server" ID="btnOpenTest" Text="Start" OnClientClick="OpenDialogToTest(); return false;"/>
The
return false;
line after calling your
JavaScript
function will prevent the
Button
to cause a full postback.