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

In Ajax button click stop working after using tooltop onclick

1 Answer 45 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
R
Top achievements
Rank 1
R asked on 18 Aug 2010, 11:52 AM
After I implemented code for tooltip click show the ajax my code for ajax button click is stop woring please see the code below

Thanks

////////////
///aspx code
////////////
 
 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <asp:DataList ID="thumbRotatoralt" runat="server" OnItemDataBound="ParentList" OnItemCommand="AddToBasket_ItemCommand" EnableViewState="true">
                <ItemTemplate>
<asp:Button ID="btnCart" runat="server" CssClass="pbuttonssmal" Text="Add to Basket"
                                        CommandName="AddItemToBasket" onfocus="Hilite(this)" onblur="Hilite(this, false)" />
 
            </ItemTemplate>
            </asp:DataList>
        </ContentTemplate>
    </asp:UpdatePanel>
 
    <telerik:RadToolTip ID="RadToolTip2" runat="server" Width="100px" ShowEvent="OnClick"
        TargetControlID="link2" IsClientID="true" HideEvent="LeaveToolTip" Position="Center" EnableShadow="true"
        Animation="Resize" ShowDelay="0" RelativeTo="Element" Text="Right-click on the picture above to show the RadToolTip." />
 
        <telerik:RadToolTipManager runat="server" ID="RadToolManager1" EnableShadow="true"
            ShowEvent="OnClick"
            OnClientShow="OnClientShow"
            Skin="Default"
            ShowDelay="200"
            AutoCloseDelay="5000"
            Width="300px"
            Position="MiddleRight"
            RelativeTo="Element">
        </telerik:RadToolTipManager>
 
 
 
<script type="text/javascript">
 
    var lastActiveToolTip = null;
    function OnClientShow(sender, args) {
        lastActiveToolTip = sender;
    }
 
   function beforeunload() {
        var activeTooltip = Telerik.Web.UI.RadToolTip.getCurrent();
        if (!activeTooltip) activeTooltip = lastActiveToolTip;
        if (activeTooltip) {
            var targetElement = activeTooltip.get_targetControl();
            activeTooltip._registerMouseHandlers(targetElement, false);
        }
    };
 
    if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
        window.attachEvent('onbeforeunload', beforeunload);
    }
    </script>

////////////
///my code behind
////////////
 
protected void AddToBasket_ItemCommand(Object sender, DataListCommandEventArgs e)
    {
 
        //my click event code to save changes to database
    }
 
 
 
    protected void ParentList(object sender, DataListItemEventArgs e)
    {
        DataListItem item = e.Item;
 
        if ((item.ItemType == ListItemType.Item) ||
            (item.ItemType == ListItemType.AlternatingItem))
 
        Button btnCart = (Button)item.FindControl("btnCart");
 
        btnCart.ToolTip = "Item(s) added to basket";
        
        RadToolManager1.TargetControls.Add(btnCart.ClientID, true);
        }
    }

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 20 Aug 2010, 01:23 PM
Hello R,

 I already answered your support threads and provided modified demos there and I suggest to continue our communication there.

Greetings,
Svetlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ToolTip
Asked by
R
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or