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: “”
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"] = ", tom's blog";

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… 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)