I have a usercontrol page which has a label on it and the onLoad code for the label is written in C#. The page I added the usercontrol to has a button. Is there any way for me to code the usercontrol so that it changes the label in response to the button press? Preferably this would be done from the usercontrol page in C#. I’m not sure if it would affect anything about this but the non-usercontrol page has the code behind done in VB.
Thanks for any insight on this.
In the code for your Page.aspx add a declarative event handler for the button click and add the following code within it alongside the other logic-
C#
VB.NET
or (if the user control label change is the only response to the click)-
C#
VB.NET
In your user control-
The method should be public so it can be accessed from the page.