RadRotator OnItemClick change img src

2 posts, 0 answers
  1. Michael
    Michael avatar
    16 posts
    Member since:
    Dec 2011

    Posted 05 Nov 2013 Link to this post

    Hello,

    I would like to change an image src to the image that i click on in radrotator.

    <img id="propImg" runat="server" src="" />
     
    <telerik:RadRotator ID="thumbRotator" runat="server" BackColor="Transparent" OnItemClick="viewImage"  EnableRandomOrder="true" BorderStyle="NotSet" BorderWidth="0" BorderColor="Transparent"
    PauseOnMouseOver="true" RotatorType="CoverFlowButtons" Width="430" Height="180" ItemHeight="190px" ItemWidth="200px" FrameDuration="1"  ScrollDirection="Left, Right" Skin="MetroTouch">
                        <ItemTemplate>
                            <asp:Image ID="myImage" Width="190px" Height="180px" runat="server" ImageUrl='<%# Container.DataItem %>' AlternateText='<%# VirtualPathUtility.GetFileName(Container.DataItem.ToString()) %>' />
                        </ItemTemplate>
                     </telerik:RadRotator>


    Would appreciate some help!

    Thanks!
  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 08 Nov 2013 Link to this post

    Hi Michael,

    In the handler of the server-side event ItemClick, you can access the clicked item via the arguments parameter, locate the image inside and change its ImageUrl. For your convenience I have attached a sample project that demonstrates this approach. Please use it to achieve the desired functionality.

    Regards,
    Slav
    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
Back to Top