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

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

Webpart - link to a document

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :SharePoint

how can I open a document from a document library from a webpart (c#).

I know the name of the document, but I cant figure out how to open it....



View Complete Post

More Related Resource Links

How to modify Add New Document link in a OOB list viewer webpart


Hi All,

I am using an OOB List viewer webpart to show a document library in a webpart page.

I am getting this link at the end "Add new Document". I would like to customize this link to show some other text.

Can anyone help me in this? Any hint will be highly appreciated.


Rahul Rashu

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?

[Client OM] Link to a Document

How do i create a "Link to a Document" ListItem in C#, using Client Object Model?   Thanks, SPN00b

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?

How can I change the height of the rows in a document library webpart view to minimize the space bet

In SP2010 documents listed in a document library view (attached as webpart) are quite far from each other (height of each row is too big). How can I change the height that spaces between the documents are limited to a minimum, hence more documents are visible on my screen. (e.g. if I have many documents in my document library and add a webpart to my page that should show all documents, I would see more documents if the height of the row would be smaller (e.g. 16px) and spaces minimized. Moreover how can I make a smaller height for each row the default height?

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.

Dataview Webpart - display document type icon with status

Hello, I recently came across an excellent post by Marc Anderson on how to surface the document icon within a DVWP. http://sympmarc.com/2008/09/10/displaying-the-document-type-icon-in-a-dvwp-in-sharepoint/ What I wanted to know is has anyone any knowledge of how to extend this so that the icon will reflect if a document is checked out? Thank you for your comments and thoughts. Sincerely, Tim

Add New Document in DataView Webpart

I am adding a dataview webpart for a document library "Shared document". Inside that library i am having two folders. So I am adding two dataview webpart in my home page and giving filter criteria so that one webpart will display content of folder1 and second webpart will contain content of folder 2. Now the problem is when I am adding "Add New Document" link it should open the upload.aspx of mainsite>Shared Document>folder1 but it is opening mainsite>Shared document I tried to use this code to get root folder but when i am using this I am getting rootfolder as blank in the url <a href="../_layouts/Upload.aspx?List={ddwrt:ListProperty('Name')}&amp;RootFolder={ddwrt:GetVar('RootFolder')}>Add New Document</a> Any Help???

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.

Can SharePoint 2010 Tag Cloud webPart show managed keywords tags only from Document Library

Can SharePoint 2010 Tag Cloud webPart show managed keywords tags only from a specified Document Library ? Also can i add multiple document libraries tagged for a single tag cloud webpart?

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?
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