ClientSide Imagefilename and Imageurl

2 posts, 1 answers
  1. Henrik Stensgaard
    Henrik Stensgaard avatar
    3 posts
    Member since:
    Oct 2008

    Posted 15 Feb 2009 Link to this post


    Is there a way to get the imagefilename and url of the image clicked on using clientside Javascript? 
  2. Answer
    Fiko avatar
    1406 posts

    Posted 16 Feb 2009 Link to this post

    Hello Henrik,

    You could find the html element that wraps the items in the item template. You should attach a handler to the OnClientClick event of the RadRotator contro, then inside this handler you could follow this logic: (using the second parameter of the handler - arg ) :

    • Get the reference to the item that has been currently clicked on e.g :
      var clickedItem = arg.get_item(); 
    •  get the reference  to the html item that wraps the item content ( the alert(htmlElement.innerHTML); function will print the content of this element ) :
      var htmlElement = clickedItem.get_element(); // LI element
    • proceed with this element as a standard html element and find its child elements, depending of your ItemTemplate construction.

    I hope this helps.

    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