link documents in sharepoint 2010
-
16-10-2019 - |
Question
how can i create a link to a document in a library in c# using the object model in sharepoint 2010?
Solution
A combination of SPList and SPListItem.GetItems will do the job. Note that SPListeItem has a ".URL" field.
The links have sample code that is a good start.
OTHER TIPS
In fact, I would go with the following solution, if you are using the regular object model. I can't tell if that it would work also with the client object model.
Use the Content Type "Link To a Document" and use the following code to make it work. I had to do it for one of my projects, and it is definitely the way to go.
Check it here
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange