Hello,
I'm busy developing a custom control that extends a LinkButton. When someone moves the mouse over the link more information should appear in a Label. It is possible to make for every link a new Label in the control itself, but with 100 links that would mean that I also make 100 labels which increases that size of the HTML-code unneccesary. Besides, only one label can be shown 1 at a time.
I want it like this:
Now the problem is in the part: AltLabel="lbl".
When the property is defined as:
I get the error "Cannot create an object of type 'System.Web.UI.WebControls.Label' from its string representation 'lbl' for the 'AltLabel' property.". This makes sense cause I pass a string instead of a Label.
I also tried the following but that didn't help either:
I really hope someone can help me.
Thanks in advance.
Kind regards,
Niels
I'm busy developing a custom control that extends a LinkButton. When someone moves the mouse over the link more information should appear in a Label. It is possible to make for every link a new Label in the control itself, but with 100 links that would mean that I also make 100 labels which increases that size of the HTML-code unneccesary. Besides, only one label can be shown 1 at a time.
I want it like this:
Code:
<asp:Label runat="server" ID="lbl" style="display:none;ponOsition:absolute;background-color:rgb(255,255,0)"></asp:Label>
<mc:LinkButtonWithAltDiv runat="server" ID="lb1" AltLabel="lbl" lblText="more info of link 1" Text="Link 1" CommandName="Select" />
<mc:LinkButtonWithAltDiv runat="server" ID="lb2" AltLabel="lbl" lblText="more info of link 2" Text="Link 2" CommandName="Select" />
<mc:LinkButtonWithAltDiv runat="server" ID="lb3" AltLabel="lbl" lblText="more info of link 3" Text="Link 3" CommandName="Select" />
Now the problem is in the part: AltLabel="lbl".
When the property is defined as:
Code:
private Label _label;
public Label AltLabel
{
get { return _label; }
set { _label = value; }
}
I get the error "Cannot create an object of type 'System.Web.UI.WebControls.Label' from its string representation 'lbl' for the 'AltLabel' property.". This makes sense cause I pass a string instead of a Label.
I also tried the following but that didn't help either:
Code:
private Label _label;
public string AltLabel
{
get { return _label.ToString(); }
set { _label = (Label)FindControl(value); }
}
I really hope someone can help me.
Thanks in advance.
Kind regards,
Niels