Error when change tooltip content within web control

  1. #1

    Error when change tooltip content within web control



    Dear coolite team,

    I try to put a textfield and a tooptip in web control(testtip.ascx), it runs ok, but when I try to change ext:tooltip content in Page_Load event of the control, the browser report below error:

    Line: 97
    Char: 329
    Error: 'this.target' is null or not object

    If I put the them in a normal aspx page, there's no error.
    I wonder is it a bug or just my misunderstanding, pls help check, thanks a lot.

    P.S. below are code for reference

    testtip.aspx (main page)
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testtip.aspx.cs" Inherits="Web.testfolder.testtip" %>
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    
    
    <%@ Register src="testtip.ascx" tagname="testtip" tagprefix="uc1" %>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
    </head>
    <body>
        <ext:ScriptManager ID="ScriptManager1" runat="server">
        </ext:ScriptManager>
        
        <form id="form1" runat="server">
        
        
    <ext:TextField ID="TextField1" runat="server" Width="80" Text="Hello!"/>
    
    
    <ext:ToolTip ID="tipForTextField1" runat="server" Target="TextField1" Html="tip!!!" />    
        
            <br />
            <br />
            <uc1:testtip ID="testtip1" runat="server" />
            <br />
        
        
    
        </form>
    </body>
    </html>
    testtip.aspx.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    
    namespace Web.testfolder
    {
        public partial class testtip : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                tipForTextField1.Html = "Changed!!!";
            }
        }
    }

    testtip.ascx (user control)
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="testtip.ascx.cs" Inherits="Web.testfolder.testtip1" %>
    
    
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    
    
    <ext:ScriptManagerProxy ID="ScriptManagerProxy" runat="server" Theme="Gray">
    </ext:ScriptManagerProxy>
    
    
    <ext:TextField ID="TextField1inControl" runat="server" Width="80" Text="Hello!"/>
    
    
    <ext:ToolTip ID="tipForTextField1inControl" runat="server" Target="TextField1inControl" Html="" />
    testtip.ascx.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    
    namespace Web.testfolder
    {
        public partial class testtip1 : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                tipForTextField1inControl.Html = "Changed!!!";
            }
        }
    }
  2. #2

    RE: Error when change tooltip content within web control

    Hi,

    Try to change Targtet like it
    Target="#{TextField1}"*


  3. #3

    RE: Error when change tooltip content within web control

    Thanks Vladimir, it works !
    Pls close this post, thanks.

Similar Threads

  1. [CLOSED] Tooltip With Dynamically created content
    By logicspeak in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 14, 2012, 1:55 PM
  2. [CLOSED] Change button icon and tooltip dinamically
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 18, 2011, 3:33 PM
  3. Replies: 1
    Last Post: Nov 23, 2010, 7:31 PM
  4. Replies: 0
    Last Post: Oct 19, 2010, 7:39 AM
  5. Replies: 2
    Last Post: May 05, 2010, 10:23 AM

Posting Permissions