0

I wrote a web part which creates items/events in my calendar list. There is a column which holds a hyperlink field. The column name is 'Form Link'. I can write my hyperlink from my code to the list item, but I would like to know how I can write the description - so the link will show the description text instead of the actual link.

this line writes the link to the field

calendarListItem["Form Link"] = "/SitePages//New%20Booking.aspx?bid=" + formlink;

What can I add or change to also write the description to this field.

0

SPFieldUrlValue is the class you are looking for.

SPFieldUrlValue UrlValue = new SPFieldUrlValue(formlink);
UrlValue.Url
UrlValue.Description

SPFieldUrlValue class

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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