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

enter image description here


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;

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

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.