PDA

View Full Version : [CLOSED] Tooltip not being set in the Codebehind...



Fahd
Jul 13, 2012, 3:19 PM
I'm trying to Add a tooltip in the codebehind, but its not being set.



<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">

protected void UpdateToolTip(object sender, DirectEventArgs e)
{
var t = new ToolTip()
{
ID = "Tooltip1",
Target = Button2.ClientID,
Title = @"Comments Added:",
Html = "It works...",
};
Controls.Add(t);
t.Render();
}

</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Simple Form Panel - Ext.NET Examples</title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="Button2" ArrowAlign="Right" Icon="Accept" Text="Update" OnDirectClick="UpdateToolTip"
runat="server" />
</body>
</html>

Vladimir
Jul 13, 2012, 3:33 PM
1. Please use ConfigID instead ClientID


Target = Button2.ConfigID,


2. For button you can use its ToolTip string property


Button2.ToolTip = @"Comments Added:";

Fahd
Jul 13, 2012, 6:07 PM
It works if I use 'Html' tag, but NOT Tooltip, it display blank, screen shot attached.

4482



<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">

protected void UpdateToolTip(object sender, DirectEventArgs e)
{
var t = new ToolTip()
{
ID = "Tooltip1",
Target = Button2.ConfigID,
ToolTip = @"It works...",
};
Controls.Add(t);
t.Render();
}

</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Simple Form Panel - Ext.NET Examples</title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="Button2" ArrowAlign="Right" Icon="Accept" Text="Update" OnDirectClick="UpdateToolTip"
runat="server" />
</body>
</html>



1. Please use ConfigID instead ClientID


Target = Button2.ConfigID,


2. For button you can use its ToolTip string property


Button2.ToolTip = @"Comments Added:";

Daniil
Jul 13, 2012, 7:00 PM
Vladimir has suggested to use the ToolTip property of the Button, not of the ToolTip itself. You should not use the ToolTip property of the ToolTip control.



2. For button you can use its ToolTip string property


Button2.ToolTip = @"Comments Added:";

Fahd
Jul 13, 2012, 7:12 PM
Opps, my fault... sorry. Thanks for the correction.


Vladimir has suggested to use the ToolTip property of the Button, not of the ToolTip itself. You should not use the ToolTip property of the ToolTip control.