Click here to Skip to main content
15,905,915 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
I need to develop a web application which opens the word document when users clicks the button in the browser.This was done by taking a single word document in my application folder.**Now i need to take multiple documents and display all the file names when user clicks the button in the browser.How can i do this.**

    <pre><pre>
System.Diagnostics.Process objDocProcess = new System.Diagnostics.Process();
objDocProcess.EnableRaisingEvents = false;
objDocProcess.StartInfo.FileName = Server.MapPath(@"OpenOfficeDoc\TestDoc.odt");
objDocProcess.Start();

How to modify my code such that it displays all the file names on button click

What I have tried:

i tried the above code but how can i modify my above code such that it displays all the file names
Posted
Updated 17-Dec-16 12:17pm

1 solution

Ummm... Your code is launching the documents ON THE SERVER, NOT THE CLIENT. Do you see a problem with that?

All of your ASP.NET C# code runs entirely on the server, never the client. Code running in the browser would be the Javascript code you write into a .js file or directly in a web page in a <script> tag.
 
Share this answer
 
v2
Comments
kav@94 18-Dec-16 7:37am    
can you please show me how to do that
Dave Kreskowiak 18-Dec-16 10:16am    
I already told you the only way this is going to work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900