In Ajax button click stop working after using tooltop onclick

2 posts, 0 answers
  1. R
    R avatar
    2 posts
    Member since:
    Aug 2008

    Posted 18 Aug 2010 Link to this post

    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);
            }
        }
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 20 Aug 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top