I have this list with artists that I manipulate with C#. I can get all te values of the list with this code part and change

SPListItem listItem = properties.ListItem;
SPWeb artistWeb = properties.Web;
string artist = listItem["Artiest"] as string;
string adres = listItem["Adres"] as string;
string postcode = listItem["Postcode"] as string;
string woonplaats = listItem["Woonplaats"] as string;
string land = listItem["Land"] as string;
string prijs = listItem["Prijs"] as string;
string rekeningnummer = listItem["Rekeningnummer"] as string;
string email = listItem["E-Mail"] as string;

string relURL = artistWeb.ServerRelativeUrl + (artistWeb.ServerRelativeUrl.EndsWith("/") ? String.Empty : "/") + artist;
relURL = relURL.Substring(1, relURL.Length - 1);
string FullURL = artistWeb.Site.MakeFullUrl(relURL);

listItem["URL"] = FullURL;

So I want to set the URL description just like the last part "listItem["URL"] = FullURL;"
Is this possible?

1 Answer 1


You have to use SPFieldUrlValue. Here is an example:

string FullURL = artistWeb.Site.MakeFullUrl(relURL);
SPFieldUrlValue UrlValue = new SPFieldUrlValue();
UrlValue.Description = "Put desciption here";
UrlValue.Url = FullUrl;

listItem["URL"] = UrlValue;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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