I'm having a problem similar to this one (http://www.telerik.com/community/forums/aspnet-ajax/rotator/button-click-from-inside-a-rotator.aspx). I am using image buttons *inside* a rotator control (that is in a user control). So for instance the following does not work:
[code]
[code]
<
asp:ImageButton ID="imgBtnForward" runat="server" OnClientClick="$find('HomeRotator1$radRotateHome').showNext(Telerik.Web.UI.RotatorScrollDirection.Right);" ImageUrl="/images//but_forward.gif" width="18" height="18" />
[/code]
How can I get this to work properly?
Thanks!
4 Answers, 1 is accepted
0
Accepted
Hello Samantha,
I was able to reproduce the problem. It occur because the asp:ImageButton inside the rotator does a postback and a new RadRotator object is created. To avoid this, you can cancel the postback by using the "return false ;" statement :
The implementation of the GoRight() function is :
I suggest you to use server parentheses to get the ID of the RadRotator as follows :
Note that server parentheses cannot be used inside a tag with attribute runat="server" (by default the <head> section has it), so if you put this code in the head section, make sure that you have wrapped it in RadCodeBlock.
Kind regards,
Fiko
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I was able to reproduce the problem. It occur because the asp:ImageButton inside the rotator does a postback and a new RadRotator object is created. To avoid this, you can cancel the postback by using the "return false ;" statement :
<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/image2.jpg" OnClientClick="GoRight(); return false;" /> |
The implementation of the GoRight() function is :
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
<script type="text/javascript"> |
function GetRadRotator() |
{ |
var oRadRotator = $find('<%=HomeRotator1.ClientID %>'); |
return oRadRotator; |
} |
function GoRight() |
{ |
var oRotator = GetRadRotator(); |
oRotator.showNext(Telerik.Web.UI.RotatorScrollDirection.Right) |
} |
</script> |
</telerik:RadCodeBlock> |
I suggest you to use server parentheses to get the ID of the RadRotator as follows :
var oRadRotator = $find('<%=HomeRotator1.ClientID %>'); |
Note that server parentheses cannot be used inside a tag with attribute runat="server" (by default the <head> section has it), so if you put this code in the head section, make sure that you have wrapped it in RadCodeBlock.
Kind regards,
Fiko
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Samantha
Top achievements
Rank 1
answered on 23 Dec 2008, 10:37 PM
Thank you!!
0
Gilberto Moreno
Top achievements
Rank 1
answered on 13 Jul 2009, 09:36 PM
i need that when lose focus in image of radrotator, this follow showing the images of AutomaticAdvanced manner,that stops, why?
RadRotator is rotatorType=AutomaticAdvanced
help me, please.
Best regards
Gilberto
RadRotator is rotatorType=AutomaticAdvanced
help me, please.
Best regards
Gilberto
0
Hi Gilberto,
We are sorry but we cannot reproduce the scenario on our side. We are much willing to help, but we will need your further cooperation. Could you please open a new support ticket, send us a simple running application which demonstrates your scenario and reproduces the issue you experience? We will take a closer look at your code, test it on our side, investigate the issues and do our best to help you.
Additionally, it will be best if you send us some screenshots of the desired behavior.
We are looking forward to hearing from you.
Sincerely yours,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
We are sorry but we cannot reproduce the scenario on our side. We are much willing to help, but we will need your further cooperation. Could you please open a new support ticket, send us a simple running application which demonstrates your scenario and reproduces the issue you experience? We will take a closer look at your code, test it on our side, investigate the issues and do our best to help you.
Additionally, it will be best if you send us some screenshots of the desired behavior.
We are looking forward to hearing from you.
Sincerely yours,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.