Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to display the images of the url typed in a custom webpart . i.e if i type url name (www.google.com) , atomatically it should display the small logo of google in webpart .Anyone with this idea ? For all the url there is associated logo , like sharepoint site when typed , shows an default image.

share|improve this question
    
Please provide a little more detail in the question about the context of what you're trying to accomplish. Three answers and two of the three have revealed more detail about what you need. –  James Love Oct 3 '11 at 10:05
    
yea sure , i have a spgridview which has column named MyLinks where i display items from list.There is also a button to add new links .When i click button enter url as(i.e google.com) i should see the favicon of google in gridview –  Nikhil Oct 3 '11 at 16:06
add comment

4 Answers

make HTTPRequest to entered url and parse received HTML for FAVICON url value if any; then use extracted favicon url to display associated image

share|improve this answer
add comment

Nikhil maybe create a list and link the URL to a logo. And then use a DataView Webpart to show an image based on the URL. Hope that helps Patrick

share|improve this answer
    
no i need to type any site name and display the logo of the associated site i.e yahoo.com/favicon.ico –  Nikhil Oct 3 '11 at 8:49
add comment

Provided your custom webpart has text entry , you could enable and use ajax , so that as you type on the fly , your server code can check url and display an image based on the url , in an image control in the same webpart.

share|improve this answer
    
no i am using OOTB newform.aspx , where i enter my url . –  Nikhil Oct 3 '11 at 8:48
add comment
up vote 0 down vote accepted

you can use spgridview properties to display the image associated with the url. http://www.google.com/favicon.png gives you the images . display these in hyperlinkbound field of spgridview

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.