This is a migrated thread and some comments may be shown as answers.

RadTooltip doesn't show data

1 Answer 76 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Luu
Top achievements
Rank 1
Luu asked on 02 Apr 2009, 08:18 AM
I have an AJAX form, one will let user type their input. If user click "Send" button, a modal-box will appear as so user can confirm their input. I use RadToolTip to solve the problem. But after user click "Send" button, the tooltip apear without any information in it (which has been done in the button click Event).

Any suggestion? Here is my code:
THE FORM: 
 
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
<asp:UpdatePanel ID="UpdatePanel2" runat="server"
                        <ContentTemplate> 
<telerik:RadTextBox ID="txtInput" runat="server"></telerik:RadTextBox><br /> 
<asp:Button ID="bttnSend" runat="server" Onclick="bttnSend_Click"></asp:Button ><br /> 
</ContentTemplate> 
                        <Triggers> 
                        <asp:AsyncPostBackTrigger ControlID="bttnSend" EventName="Click" /> 
                        </Triggers> 
                    </asp:UpdatePanel> 
 
THE TOOLTIP: 
 
<telerik:RadToolTip ID="pAttack" runat="server" ShowEvent="OnClick" Skin="Office2007" 
        TargetControlID="bttnAttack" Position="Center" RelativeTo="BrowserWindow" Title="Tấn công" 
        Modal="True" ShowDelay="100" ShowCallout="False" ManualClose="true"
        <asp:UpdatePanel ID="UpdatePanel1" runat="server"
            <ContentTemplate> 
<asp:Label ID="lblConfirm" runat="server"></asp:Label> 
 
            </ContentTemplate> 
        </asp:UpdatePanel> 
    </telerik:RadToolTip> 
 
SEND BUTTON ONCLICK EVENT: 
protected void bttnSupport_Click(object sender, EventArgs e) 
this. lblConfirm.Text = this. txtInput.Text; 

By the way, how did you make the Format Code Block? What RadControl are you using?

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 06 Apr 2009, 08:50 AM
Hi Luu,

I examined your code and prepared a sample demo based on it. However, you are using a few buttons and you did not described your scenario in details - that is why I assumed that you mean the very same button with all your references  and changed your code in this manner. After I did this I was able to reproduce the problem.

If my modifications are correct and replicate your setup, in order to get the desired behavior you should go through the following steps:

  1. Set ShowEvent=FromCode for the tooltip and show it through its server-side method Show() in the button's handler - otherwise, the tooltip is shown before the new text of the label is set and that is why it shows without the new content.
  2. Put the tooltip also in the update panel in order to correctly show it after the AJAX update.

This being said, after I modified your code in the following manner:

ASPX:

  <form id="form1" runat="server">  
        <asp:ScriptManager ID="RadScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">  
            <ContentTemplate> 
                <telerik:RadTextBox ID="txtInput" runat="server">  
                </telerik:RadTextBox> 
                <br /> 
                <asp:Button ID="bttnSend" runat="server" OnClick="bttnSend_Click"></asp:Button><br /> 
                <telerik:RadToolTip ID="pAttack" runat="server" ShowEvent="FromCode" Skin="Office2007" 
                    TargetControlID="bttnSend" Position="Center" RelativeTo="BrowserWindow" Width="200" 
                    Height="200" Title="Tấn công" Modal="True" ShowDelay="100" ShowCallout="False" 
                    ManualClose="true">  
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
                        <ContentTemplate> 
                            <asp:Label ID="lblConfirm" runat="server"></asp:Label> 
                        </ContentTemplate> 
                    </asp:UpdatePanel> 
                </telerik:RadToolTip> 
            </ContentTemplate> 
            <Triggers> 
                <asp:AsyncPostBackTrigger ControlID="bttnSend" EventName="Click" /> 
            </Triggers> 
        </asp:UpdatePanel> 
    </form> 

code-behind:

   protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
    protected void bttnSend_Click(object sender, EventArgs e)  
    {  
        this.lblConfirm.Text = this.txtInput.Text;  
        pAttack.Show();  
    }   

In case I have misunderstood you, please prepare a very simple demo project, open a new support ticket and send it to me along with detailed reproduction instructions and explanations of the actual and the desired behavior.



Sincerely yours,
Svetlina
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
ToolTip
Asked by
Luu
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or