.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

[Client OM] Link to a Document

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :SharePoint
How do i create a "Link to a Document" ListItem in C#, using Client Object Model?   Thanks, SPN00b

View Complete Post

More Related Resource Links

Add a new link to a document using the client object model


I need to add a new document link to a document library using the client object model. What I want to do is the same as the code sample below but instead of creating a new document I want to create a new link to a document.

ClientContext context = new ClientContext("http://wdev2008:22880");
List list = context.Web.Lists.GetByTitle("Test Doc Link Library");

FileCreationInformation fileCreateInfo = new FileCreationInformation();
fileCreateInfo.Content = new byte[] { 0x33 };
fileCreateInfo.Url = "zerobyte";
File file = list.RootFolder.Files.Add(fileCreateInfo);



Creating a custom column with a link to document (other than the name field) in document library



I have a document library with the standard name column linking to the document. However, we'd like to create a custom field and have that link to the document (and edit item menu).

How is this best accomplished?

Thanks in advance!


Can i Map to external link from document library folder



Is There any one know how to link document library folder is to external site 



How do I get the Name link to go to document properties instead of the doc itself?

Hello.  I need to link my documents/photos/etc to their properties page (DispForm.aspx), not directly to the item itself.  How do I change my code to do this?  I have SharePoint Designer, but I'm no big expert.  I have looked through all the different column names and types and cannot find one that does this.  Thanks.  Oh, I'm on WSS 3.0.

Search crawler 'breaks' Document ID link

Hi all - we have a Sharepoint 2010 development server up and running (very much Out of the Box configuration). The Document ID functionality has been enabled and appears to be working OK - each document has its own unique ID as predicted. In a team site (Corporate Comms), we have a document library where our corporate logo has been loaded (a small .bmp file). This image file has a unique Document ID. On the top level site, I have created a link to the corporate logo so that it appears on the 'entry' web page. The link to the image is : http://<servername>/_layouts/DocIdRedir.aspx?ID=CH07-7-1  where CH07-7-1 is the Document ID When first created, everything works OK and the image appears on the front page. However, once a search crawl has been run (either full or incremental), the image disappears and is replaced by a red cross (i.e. the URL link has been broken). I have tried this with a word document link (as opposed to a .bmp image) and this still works OK. I have also tried storing the image in a picture library (as opposed to a document library) and the same thing happens. Is there something funny happening specific to the .bmp image/Document ID/crawler ? Anything I need to configure ? Any help would be appreciated. Thanks, Richard.    

Need to link multiple External Content List items to a single document metadata column

I have an external content list - for my purposes, the data isn't any fancier than a list of terms provided by a web service (read only - I don't need update/delete functionality). I want to be able to link any subset of those terms to a single document metadata column (in other words, I need it to work like a normal content list that is defined to allow multiple values in a column) but SharePoint doesn't let me do that on an ECL. I need the content list to be externally driven since more values are going to be added to an outside system over time, but I think it's possible that I may not need a full-fledged ECL list to make this work this way in SharePoint. Just to clarify: I don't need the metadata values in my documents to maintain a PERSISTENT link to the web service (if someone changes an underlying value in the web service DB, it doesn't need to be updated in the document table too). I just want SharePoint to offer up an updated set of source values from the web service if somebody goes in and edits the document metadata. Any ideas for how I can make this work?

In data view web part - how to display document name with link that opens lookup document rather tha

I have a list with a lookup column to create relationships with documents in a separate library. I am creating a data view web part to display each item in the list. One of the fields I want to display is the document field (the lookup column). I want this to be in the form of the related document's name with link to directly open the source document itself (Word, PPT, ...). Now I am only managing to display the document name linked to opening the document's display form of the related document library, and then I have to click the document's name there to open it. Alas one unnecessary click too many. Any wize tips? Henning

Clicking on "Shared Documents" gives link to download instead of opening document library

Hi, I hope someone can help! All of a sudden (I don't know if someone has changed something!), whenever anone clicks on a link to open the "shared documents" document library in a specific site within our sharepoint site, instead of opening the document library, it instead gives a download dialog for a zip "AllItems.aspx" as a zip file. Anyone got any iteas what could have gone wrong and how to correct the issue?   Many thanks for any help!

How can I switch the "Linked to document" link from the 'name' column to another column e.g. title

In SP2010 it is not possible to click on the icon to open a document in a list web part. Therefore I want to move the 'linked to document' feature from the name colum to the title column (as I do not show the name colum on the site). How can I do it or how can I make sure that clicking on the document icon leads me to the document and not to the edit menu?

Silverlight client object model : Read a document from a document library

How do I read/download a document/file from a SharePoint document library using silverlight client object model? The most closest function that I found was: Microsoft.SharePoint.Client.File.OpenBinaryDirect() but this seems to be throwing an exception "Operation not supported".

How to add more items link in document library?

Hi, I have a document library, i need to display limit number of items with "more items" link. if i click more items link it will display all the items in the document library. how to create more items link in document library? thanks.

unexpected error while clicking on document link

Hi, To upload 50 MB file, execution time has been changed, and large size document can be uploaded. but, while clicking on the document link to open , it shows 'unexpected error has occured"  and no log entries. Please help me in this.Thanks in advance.

Tag Cloud web part of SharePoint 2010, link only to document library not to document ?

Do tag cloud show only Document library links when the tag is click in Tag cloud web part of SharePoint 2010. Can it show all the document links instead of document library links?

How can I edit the link to the document in a Approval Task email?


With the 2010 out of the box Approval workflow, the emails and tasks work just great, however, when a user receives the email, the instructions look like this:


To complete this task:
2. Perform the specific activities required for this task.
3. Use the Open this task button to mark the task as completed. (If you cannot update this task, you might not have access to it.)


Currently, we are using a friendly url for our users, in order to access their SharePoint site.  The <LINKED DOCUMENT> when clicked on, gives them an error and doesn't take them to the actual document in the SharePoint site, because of the fact that we are using a different url name for the site.

If there any way I can edit this auto-generated email so that the links will always be to the friendly url of our SharePoint site with each document?


Thanks in advance!

View previous version of a file in document library using Client Object Model




Using Server-side object model, it is pretty simple to get the previous file versions. Say I wanted to view a file in its initial version, all I’d need to do is :




When using Client object model, I couldn’t any analogous method/property which would let me fetch the previous version of file.

Can somebody point me to a sample or the property which would serve my purpose?

Publishing page: link to a document on another collection


I have an .aspx page in my publishing site. On that page I want to put a link to a document that is in another site collection. So I edit the page, highlight the link text and then click the link glyph on the toolbar to bring up the "Edit Hyperlink Properties" window, and click the "Browse" button expecting to be able to navigate to the other site collection. But when I put the full URL of that site collection in the "Location (URL)" box I get "cannot find this site in the current site collection."

Is there a workaround or setting for this? Is there any way possible I that can use the Edit Hyperlink Properties to navigate to another site collection?

How to Link to a Document content type but linking to a Folder

I have implemented the known "Link to a Document" content type to a Document Library (referenced below).  This works fine to documents, but we need to also enter UNC paths to Folders like file://\\servername\sharename\foldername

We can NOT create shortcuts to these folders, which is a work around someone else published.

If you add the Hyperlink field it allows you to enter a UNC path to externally stored folder just fine. So there must be some way to make this Link to a Document content type also open UNC Folders accurately.


Code Snippet
function HasValidUrlPrefix_Override(url)
            var urlLower=url.toLowerCase();
            if (-1==urlLower.search("^http://") &&
            -1==urlLower.search("^https://") && -1==urlLower.search("^file://"))
            return false;
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend