Add URL item to SharePoint Links list

If you create a link list (default lists type: 103), the way to add a new SPListItem by code is quite tricky.

If you want to add an new url to this links list with these meta data:

url: “http://tom.vangaever.be/blog”
Description: tom's blog

you'll notice that there is no description property.

the example below shows you how to add a new item:
SPList linkslist = web["links"];
SPListitem newlink = linkslist.Add();
newlink["URL"] = "http://tom.vangaever.be/blog, tom's blog";
newlink.update();

NOTE: there must be a space after the comma, otherwise it won't work.

when you open the links list, you'll notice that the URL displayed is “tom's blog” and when you click on it… http://tom.vangaever.be/blog opens.

good luck :)

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)