I'm creating a dynamic tooltip control that will reference javascript when moused over that is located in the master page, which uses the tool tip manager in the master page to call ajax from the master page's code behind. I think that's all working fine. It's a combination of examples that you've provided. It will load nicely, but then the tooltip will go blank and a javascript error is produced.
It's an "Argument Out of Range" exception triggered by Sys$UI$Bounds when fetching the ToolTipBounds. The 'x' value is NaN when an integer is expected. The element in question is the control which is placed in a RadDock. The tool tip does appear just below the div element and centered. I'm unsure why it wouldn't have an x value. I've tried to provide as much information as I can.
Thanks for your assistance, opinions, etc.
EDIT: Version 2012.2.912.40
Error Stack
Javascript on MasterPage
RadToolTipManager declaration on MasterPage
OnAjaxUpdate in MasterPage's code behind
Tool Tip Control markup
Tool Tip Control code behind
It's an "Argument Out of Range" exception triggered by Sys$UI$Bounds when fetching the ToolTipBounds. The 'x' value is NaN when an integer is expected. The element in question is the control which is placed in a RadDock. The tool tip does appear just below the div element and centered. I'm unsure why it wouldn't have an x value. I've tried to provide as much information as I can.
Thanks for your assistance, opinions, etc.
EDIT: Version 2012.2.912.40
Error Stack
Uncaught Sys.ArgumentOutOfRangeException: Sys.ArgumentOutOfRangeException: Value must be an integer.Parameter name: xActual value was NaN. ScriptResource.axd:237Error$create ScriptResource.axd:237Error$argumentOutOfRange ScriptResource.axd:302Function$_validateParameterType ScriptResource.axd:217Function$_validateParameter ScriptResource.axd:130Function$_validateParams ScriptResource.axd:84Sys$UI$Bounds ScriptResource.axd:3924window.$telerik.window.TelerikCommonScripts.Telerik.Web.CommonScripts.getBounds ScriptResource.axd:247$T.RadToolTip._getBoundsRelativeToElement ScriptResource.axd:429$T.RadToolTip.getToolTipBounds ScriptResource.axd:482$T.RadToolTip._reSetToolTipPosition ScriptResource.axd:646$T.RadToolTip._reSetPositionWithoutFlicker ScriptResource.axd:651(anonymous function) ScriptResource.axd:150(anonymous function) ScriptResource.axd:47(anonymous function) ScriptResource.axd:3484Sys$WebForms$PageRequestManager$_endPostBack ScriptResource.axd:865Sys$WebForms$PageRequestManager$_scriptsLoadComplete ScriptResource.axd:1729(anonymous function) ScriptResource.axd:31(anonymous function) ScriptResource.axd:47Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:342Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335Sys$_ScriptLoader$_nextSession ScriptResource.axd:357Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:344Sys$_ScriptLoader$_nextSession ScriptResource.axd:357Sys$_ScriptLoader$loadScripts ScriptResource.axd:262Sys$WebForms$PageRequestManager$_onFormSubmitCompleted ScriptResource.axd:1344(anonymous function) ScriptResource.axd:47(anonymous function) ScriptResource.axd:3484Sys$Net$WebRequest$completed ScriptResource.axd:6364Sys$Net$XMLHttpExecutor._onReadyStateChange ScriptResource.axd:5984Javascript on MasterPage
function showToolTip(element) { var tooltipManager = $find("<%= toolTipManagerMain.ClientID %>"); //If the user hovers the image before the page has loaded, there is no manager created if (!tooltipManager) return; //Find the tooltip for this element if it has been created var tooltip = tooltipManager.getToolTipByElement(element); //Create a tooltip if no tooltip exists for such element if (!tooltip) { tooltip = tooltipManager.createToolTip(element); var message = element.getAttribute("alt", 2); tooltip.set_value(message); tooltip.set_animationDuration(0); }}RadToolTipManager declaration on MasterPage
<telerik:RadToolTipManager ID="toolTipManagerMain" runat="server" HideEvent="ManualClose" Animation="Fade" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element" Width="180px" Height="150px" Style="font-size: 18px; text-align: center; font-family: Arial;" RenderInPageRoot="True" >OnAjaxUpdate in MasterPage's code behind
protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args){ Control ctrl = Page.LoadControl("~/Controls/ToolTip/ToolTipSummary.ascx"); args.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl); ToolTipSummary details = (ToolTipSummary)ctrl; details.Data = args.Value;}Tool Tip Control markup
<div id="testId" class="toolTipGuide" alt="<%# ToolTipMessage %>" runat="server" onmouseover="showToolTip(this);">?</div>Tool Tip Control code behind
private string _tookTipMessage = "";public string ToolTipMessage{ get { return _tookTipMessage; } set { _tookTipMessage = value; }}protected void Page_Load(object sender, EventArgs e){}