I have created a custom control that has a label who's text is to be changed dynamically when it is used on a page.
The calling page has twoHyperLink Controls:
I was thinking that I should use an OnClick="SetMsg1" then in the CodeBehind for that HyperLink Control:
Control is located in Controls/TextControl.ascx, where TextMessage is the name of the label to be updated.
Can someone please help me with this?!
Thank you.
The calling page has twoHyperLink Controls:
Code:
<asp:HyperLink id="campaign1" runat="server">Sports Bar</asp:HyperLink>
<asp:HyperLink id="campaign2" runat="server">Drink Specials</asp:HyperLink></td>
I was thinking that I should use an OnClick="SetMsg1" then in the CodeBehind for that HyperLink Control:
Code:
private void SetMsg1(object sender, System.EventArgs e)
{
WHAT_GOES_HERE???.TextMessage.Text = "this text will be updated when the link is clicked!";
}
private void SetMsg2(object sender, System.EventArgs e)
{
WHAT_GOES_HERE???.TextMessage.Text = "More text to replace the old text!";
}
Control is located in Controls/TextControl.ascx, where TextMessage is the name of the label to be updated.
Can someone please help me with this?!
Thank you.