I have a problem where I'm trying to send a string between User Controls, "input.ascx" and "output.ascx", when I have more the one of each User Control.
Here is the ASPX for the parent page:
<uc:Input runat="server" id="Input1" />
<uc:Input runat="server" id="Input2" />
<uc:Output runat="server" id="Output1" />
<uc:Output runat="server" id="Output2" />
User Control Input ASCX:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
User Control Input VB.net:
Public Shared Event Button1Click(ByVal s As String)
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim s As String = TextBox1.Text
RaiseEvent Button1Click(s)
End Sub
User Control Output ASCX:
<%@ Reference Control="~/Input.ascx" %>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
User Control Output VB.net:
Public Sub New()
AddHandler UCTestUcInput.Button1Click, AddressOf DisplayText
End Sub
Private Sub DisplayText(ByVal s As String)
Label1.Text = s
End Sub
The problem is when I input into either one of the "input.ascx" it gets displayed in both "output.ascx" when it should only be displayed in the corresponding output (like input1 corresponds with output1).