Nav Buttons *inside* the rotator

5 posts, 1 answers
  1. Samantha
    Samantha avatar
    50 posts
    Member since:
    May 2008

    Posted 17 Dec 2008 Link to this post

    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]

    <

    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!

  2. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 19 Dec 2008 Link to this post

    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 :

    <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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Samantha
    Samantha avatar
    50 posts
    Member since:
    May 2008

    Posted 23 Dec 2008 Link to this post

    Thank you!!
  5. Gilberto Moreno
    Gilberto Moreno avatar
    5 posts
    Member since:
    Jul 2009

    Posted 13 Jul 2009 Link to this post

    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
  6. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 16 Jul 2009 Link to this post

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