You are here: Home » Working with SPList and a List of Links

Working with SPList and a List of Links

Posted by mosslover
No Comments »

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.
 

Your email is never shared.
Required fields are marked *




Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>