Working with SPList and a List of Links

I am working on this Top 3 Sites Webpart that saves to a list of links.  I never knew that there was a variable called SPFieldURLValue that stores the description and url for the variable in a list.  Here is an example of how it would be used in SPList:

Dim URLVariable as new SPFieldUrlValue

 UrlVariable.Url = "http://yoururl"

UrlVariable.Description = "description for url"

ListItem = List.Items.Add

ListItem("URLField") = UrlVariable

ListItem.Update() 

It's incredibly easy once you know what you are looking for.  I hope this helps one of you guys working with a list of links.  I know it did for me.
 

Leave a Reply