1

How to create site column of Hyperlink with formatting and constraints for publishing programmatically?

enter image description here

1 Answer 1

1

You can try below

SPList _list = web.Lists["ListName"];
Microsoft.SharePoint.Publishing.Fields.LinkField linkfds = _list.Fields.CreateNewField("Link", "Test") as Microsoft.SharePoint.Publishing.Fields.LinkField;
_list.Fields.Add(linkfds);
_list.Update();

Note - you should add reference to Microsoft.SharePoint.Publishing.dll

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.