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

Button and Radtoolltip ajax update

4 Answers 85 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Herve
Top achievements
Rank 2
Herve asked on 09 Oct 2013, 02:33 PM
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

4 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 14 Oct 2013, 11:24 AM
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.
0
Herve
Top achievements
Rank 2
answered on 15 Oct 2013, 08:03 AM
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>
0
Konstantin Dikov
Telerik team
answered on 17 Oct 2013, 01:46 PM
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.
0
Herve
Top achievements
Rank 2
answered on 18 Oct 2013, 12:40 AM
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


Tags
Ajax
Asked by
Herve
Top achievements
Rank 2
Answers by
Konstantin Dikov
Telerik team
Herve
Top achievements
Rank 2
Share this question
or