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

Launch a radtooltip, radalert, or a plain alert in a usercontrol?

3 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 10 Jan 2011, 04:13 PM
I seem to be having an issue, I am trying to launch a  tooltip, radalert, or a plain alert in a usercontrol. When the user clicks a button I do some computation and then at the end of the method I try to launch a popup if it was successful. But I've been having some issues since the usercontrol reloads itself every time the button is clicked, and I needed it to reload it self.

I've tried showing the RadTootip/Alert server side but it didn't work then I tried setting the text of a literal to javascript at the end of the method but that didn't work.

Any ideas on how to show a popup at the end of a button click method?

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 11 Jan 2011, 01:25 PM
Hello Jeff,

 The easiest way to achieve what you need is to use a separate RadToolTip and call its server method Show as demonstrated below (this.RadToolTip1.Show()):


http://demos.telerik.com/aspnet-ajax/tooltip/examples/relativeto/defaultcs.aspx

I am also glad to inform you that we have implemented server methods RadAlert, RadConfirm and RadPrompt which will give you built-in ability to show radalert, radconfirm and radprompt from the server and they will be available in the upcoming Q1 major release which is scheduled for March.

Regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Jeff
Top achievements
Rank 1
answered on 11 Jan 2011, 04:37 PM
It didn't work from me, here's what I did.

<telerik:RadToolTip HideEvent="LeaveToolTip" Modal="true" Position="Center" RelativeTo="Element" ShowEvent="OnClick" IsClientID="false" ID="PluginInfoTooltip" runat="server">
        <asp:Label CssClass="importantplugindetial" Font-Bold="true" runat="server" ID="PluginInfoLabel" Text=""></asp:Label>
    </telerik:RadToolTip>

and codebehind

Protected Sub InstallButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles InstallButton.Click
   If Plugins.Contains(pluginName) Then
      PluginInfoLabel.Text = "Plugin Setting Saved"
      PluginInfoTooltip.Show()
   Else
      PluginInfoLabel.Text = "Plugin Installed"
      PluginInfoTooltip.Show()
   End If
End Sub

The tooltip doesn't even show up.
0
Svetlina Anati
Telerik team
answered on 14 Jan 2011, 09:14 AM
Hello Jeff,

 I examined your code and I noticed that you have RelativeTo set to Element and you do not have a target control set. This is invalid setup because if the tooltip should be relative to an element, you should provide such and element and I suggest to set RelativeTo="BrowserWindow" for your case (you can also keep this setting and set a target control). With this change your code should work as follows:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="RadScriptManager1" runat="server">
    </asp:ScriptManager>
     
    <asp:Button ID="InstallButton" runat="server" Text="Show ToolTip" />
    <telerik:RadToolTip HideEvent="LeaveToolTip" Modal="true" Position="Center" RelativeTo="BrowserWindow"
        ShowEvent="OnClick" IsClientID="false" ID="PluginInfoTooltip" runat="server">
        <asp:Label CssClass="importantplugindetial" Font-Bold="true" runat="server" ID="PluginInfoLabel"
            Text=""></asp:Label>
    </telerik:RadToolTip>
    </form>
</body>
</html>

Note, also,. that if you by any change have ajaxified the button, you should also ajaxify the tooltip. The page above works on my side, please, test it on yours and let me know how it goes.

Kind regards,
Svetlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
General Discussions
Asked by
Jeff
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or