1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Getting the image url which is found on a specific page

Getting the image url which is found on a specific page

2 posts, 0 answered
  1. Ravish
    Ravish avatar
    12 posts
    Registered:
    27 Sep 2011
    16 Dec 2011
    Link to this post
    Hello,

    I have a user control on my page. This control is supposed to get some images which are found in a specific page. My question is:
    1. Do I have to get the id or url of the page first, where the image is found
    2. Then get all the images found in the page
    3. Select images for the control to display

    What is the best way of doing this operation???
    Thanks
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    20 Dec 2011
    Link to this post
    Hi Ravish,

    This is not an easy one, but I can suggest you two ways of achieving your goal:

     -  you can try to parse the HTML and look for the <img> </img> tags in a page and find all images.
     -  another option for you is to look recursively for the control that contains the image on a particular page. You can use FindControl to get the name of a particular control.

    Best wishes,
    Victor Velev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered