Hi,
I have a ASP.net Custom Web User Control that I have developed for our ASP.net application.
Everything works great, until I try to declare a second instance in the C# side of the code.
Without the C# declaration for the second instance it works fine declaring the second instance in the HTML side isn't a problem, but i need to set the properties in the C# side and obviously to do this I need a declaration for the second control.
I have declared the second instance just like the first but given it a different name and html id from the first.
The Error I get is as follows:
Compiler Error Message: CS0117: 'ASP.WebForm1_aspx' does not contain a definition for 'apcbutton2'
Can anyone suggest a fix or what is going wrong?
Regards in advance...
I have a ASP.net Custom Web User Control that I have developed for our ASP.net application.
Everything works great, until I try to declare a second instance in the C# side of the code.
Without the C# declaration for the second instance it works fine declaring the second instance in the HTML side isn't a problem, but i need to set the properties in the C# side and obviously to do this I need a declaration for the second control.
I have declared the second instance just like the first but given it a different name and html id from the first.
Code:
C#
apcButton apcButton1 = new apcButton();
apcButton apcButton2 = new apcButton(); // This line errors
Compiler Error Message: CS0117: 'ASP.WebForm1_aspx' does not contain a definition for 'apcbutton2'
Can anyone suggest a fix or what is going wrong?
Regards in advance...