Button and Radtoolltip ajax update

5 posts, 0 answers
  1. Herve
    Herve avatar
    39 posts
    Member since:
    Jun 2008

    Posted 09 Oct 2013 Link to this post

    Hi,

    I'm trying to automatically refresh an image button to notify the users when thy get a a message in their internal inbox (db driven) by changing the original image by another one including an alert sign (like the iPhone red circle).

    Also when the user click on that image button I would like to refresh the content of the user control to display the exact number of received messages.

    <asp:ImageButton ID="BtnNotif" width="153" height="42" runat="server" />
     
    <telerik:RadToolTip ID="RttNotifs" runat="server"
    TargetControlID="BtnNotif" RelativeTo="Element"
    ManualClose="true" ShowEvent="OnClick"
    Position="BottomCenter" RenderInPageRoot="False"
     Skin="Hotlinexxx" EnableEmbeddedSkins="false"
     Width="300px" Height="200px" >                             
        <uc1:notifications runat="server" ID="notifications" />                     
    </telerik:RadToolTip>

    I don't know exactly how to do it and do not find any relevant example on the demo website, could you please let me know how you would take care of it ?

    Thanks for your support,


    Herve

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 14 Oct 2013 Link to this post

    Hello Herve,

    About your first requirement you could use the Timer control to check your database for any changes in some time interval. 

    For your second requirement, please note that when you set the "ImageButton" control as "TargetControlID" in the RadToolTip, no postback will occur on click and you will not be able to update the tooltip directly. You could add RadAjaxPanel around the UserControl and fire AJAX request on "OnClientBeforeShow" client-side event of the RadToolTip control.

    Attached you could find a sample project with the described approach for updating the RadToolTip on button click.

    Hope that helps.

     

    Regards,
    Konstantin Dikov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Herve
    Herve avatar
    39 posts
    Member since:
    Jun 2008

    Posted 15 Oct 2013 Link to this post

    Hi Konstantin,

    Thanks for you support and sample project, the radtooltip is now refreshed each time I open it and all works fine on that side.

    In an other hand, I can refresh the image of my button with a timer only when this last one is in an ajax panel like in the code bellow, in that case the radtooltip doesn't work anymore.

    Is there in your opinion a solution allowing to refresh the image button with a timer and the tooltip when opening ?

    Again thanks,

     

    Herve

     

    <telerik:RadAjaxPanel runat="server" id="PnlAlertNotif">
     
     <asp:ImageButton ID="BtnNotif" Width="153" Height="42" runat="server" />
     
     <asp:Timer id="TimerNotif" runat="server"
     
     Interval="1200"
     
     OnTick="TimerNotif_Tick">
     
     </asp:Timer>
     
    </telerik:RadAjaxPanel>
  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 17 Oct 2013 Link to this post

    Hi Herve,

    Thank you for getting back to us.

    I am glad that part of the requested functionality is working. 

    Please note that your requirement is a custom solution that in general is out of the scope of our Support Service and should be handled on client side. 

    Nevertheless, I have modified my previously provided solution in such way that will allow you to change the ImageButton control. Please have in mind that there is no way to have the ImageButton and the Timer in RadAjaxPanel without loosing the other functionality. 

    Please test the attached files on your end and see how it works. 

     

    Regards,
    Konstantin Dikov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. Herve
    Herve avatar
    39 posts
    Member since:
    Jun 2008

    Posted 17 Oct 2013 Link to this post

    Hi Konstantin,

    Your solution is the perfect one, I thank you for this extra and 1st class support that allowed to open my mind and will help other users for sure.

    Again thanks,


    Herve


Back to Top
UI for ASP.NET Ajax is Ready for VS 2017