I'm playing around with buttons and events which are not working!
I have a project that does work and mimiced the code from there as well as what I found on hundreds of pages online. It still does not work!
The asp:Button is in my aspx file, the C# function is in the code behind aspx.cs file.
<asp:Button runat="server" Text="Test" Width="200px" OnClick="ChangeText" />
protected void ChangeText(object sender, EventArgs e)
{
Button btn = (Button)sender;
btn.BackColor = ConsoleColor.Blue;
}
when i run it it tells me:
Compiler Error Message: CS1061: 'ASP.default_aspx' does not contain a definition for 'ChangeText' and no extension method 'ChangeText' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly
reference?)< ...
Go to the complete details ...