?
Solved

How to show Sharepoint document in ASPX page?

Posted on 2012-09-07
13
Medium Priority
?
1,244 Views
Last Modified: 2012-09-07
Hi Experts,

  There is a requirement for me. I've sharepoint site. In the document library, some documents are loaded.

  The documents full searchable path is loaded as hyperlink in my ASPX page. This is achieved.

  Upon clicking the link, what I would like to do is that I would get the content and write in an ASPX page. How to achieve this? Please guide me.
0
Comment
Question by:Easwaran Paramasivam
  • 7
  • 6
13 Comments
 
LVL 50
ID: 38375699
Hello,

whilst it is possible to upload all kinds of documents to a document library, whether or not the content of these documents can be displayed in a browser is a completely different subject.

What document types does the library contain? SharePoint has some built-in functionality to display certain file types out of the box. For example Excel files can be shown with Excel Services, if they adhere to certain constraints. Similarly, Visio files can be shown in a web part. Office web apps can be used to show other Office documents. PDFs can be shown in the browser as well,

Other file types are not so easy to integrate, for example AutoCAD drawings.

Reading the contents of a file and displaying it in an ASPX page sounds like a major undertaking that very much depends on what type of file you want to open.

Can you elaborate on that?

cheers, teylyn
0
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 38375702
Thanks.

We have docx, pdf and html files.

Please explain how to handle each of them.
0
 
LVL 50
ID: 38375723
The browser will be able to display PDFs (any browser has a PDF plug-in) and HTML goes without saying. Word documents can open in Word. Why do you want to re-invent the wheel?

Just let the files be opened with the tools that are made to handle them.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 38375730
Thanks.

My question is how to get content of the specified file (by passing file path) from sharepoint.
0
 
LVL 50
ID: 38375739
Can you explain the bigger picture? Word, PDF and HTML are three completely different file formats, so need to be treated differently. Why do you want to "read" the content of the files if you can just open them in the browser?
0
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 38375755
Well. Why I need to read the content is that say for example the document stored in Sharepoint is DOC or DOCX file. There is an option that I need to provide, I would like to show the Document content in HTML format (The para content will be shown with in <p></p> tag). If I read the content only I could do some manipulation on it.

Please let me know if you need further details.
0
 
LVL 50
ID: 38375794
Well, all these document types can be displayed in the browser.  Why re-invent the wheel? For Word documents just set the library to open documents in the browser instead of the client. HTML and PDFs are already taken care of.
0
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 38375802
In web application it is OK. What about in case of windows application as Client. Say for example, in a Rich text box I would like to shown the content of a sharepoint document. In this case I could able to read the sharepoint document content. Right?

Please direct me how to achieve that.

Thanks.
0
 
LVL 50
ID: 38375830
There is no such thing as a "SharePoint document". SharePoint is not a file type. SharePoint document libraries can store all kinds of files. The file type is not tied to SharePoint but inherent in the file and any method to show the file content in a different setting is independent of SharePoint.
0
 
LVL 16

Author Comment

by:Easwaran Paramasivam
ID: 38375846
The Sharepoint document I meant is the document stored in sharepoint. You are right. There should be some method in .NET to fetch the document by some means connecting with Sharepoint. I would like to know that. Please share with me your thoughts/ideas/suggestions.

Please let me know if you need further details.
0
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 1500 total points
ID: 38375885
Please try to understand:

A PDF stored in a SharePoint library is still a PDF. If you want to access its contents to display it in a different setting, you need to use methods that can extract data from a PDF. This question relates to accessing PDF content with .Net.

A Word document stored in a SharePoint library is still a Word document. If you want to access its contents to display it in a different setting, you need to use methods that can extract data from a Word document. This question relates to accessing Word content with .Net

A HTML file stored in a SharePoint library is still a HTML file. If you want to access its contents to display it in a different setting, you need to use methods that can extract data from a HTML file. This question relates to accessing HTML content with .Net.

All this has nothing at all to do with how SharePoint works. SharePoint is (I hate to say this) just a platform. The documents retain their characteristics, even if they are stored in a SharePoint library.

For all it's worth, you can open the SharePoint library with Windows Explorer and use the SharePoint location as a file path, just like any other network drive.

In this context, the way you phrased your question does not make sense. This is not "how can I display the content of a SharePoint document in a different setting". You need to ask several different questions, e.g.

- how can I extract the contents of a Word document to display in a different setting
- how can I extract the contents of a PDF document to display in a different setting
- how can I extract the contents of a HTML file to display in a different setting

Since the three file types you listed are of a completely disparate nature, you should post three different questions in the respective topic areas.

Again: this is not about SharePoint. It's about how to access file contents of different file types with .Net.

regards, teylyn
0
 
LVL 16

Author Closing Comment

by:Easwaran Paramasivam
ID: 38375903
Thanks for your response. I got your point.
0
 
LVL 50
ID: 38377970
Can you please explain the B grade? This is the second time you assigned a B grade to one of my answers. My answers are valid. You can't assign a B simply because you don't like how things work.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Integration Management Part 2
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question