I have a web form where I have a Label and a user control. I would like that the user control would be able to change the value of the text in the Label.
How can I indicate to the user control what Label to change? (In the example I have a single Label a a single instance of the user control, but I will need to have several of both)
EDIT:The user interaction with the user control triggers the update of the external label.
EDIT2: Adding more details. My user control has a gridview, when the user adds or edit a line to the grid, I want to update the value in the label with the sum over a column of the grid. Currently I'm using the code server side, as the request to update or insert goes to the server. If possible, I prefer to do the update on the client side, as that would allow me to update my label without having to reload the whole page.
Solution: changed to use devexpress components, I use the aspxgridview client side event EndCallback in the user object. I defined a property in my user object to store the javascript function to be called in the EndCallback callback. This Property can be filled by the container page, as there I know all the IDs I need.
The code I have is:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<uc1:InvoiceItems runat="server" ID="InvoiceItems" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>