How do I launch an external program like Notepad or just opens a .DOC in MS Word from my C# / ASP.Net web application?
Posted on 2010-09-21
I have created an ASP.Net web application (code behind = C#) and now wants to launch an external program or just open a .TXT or .PDF file from a button on one of my forms. I coded everything already and the button calls a C# method and I use 'Process.Start(@m_questionAndAnswerContext.QuestionInfoURL);' inside this
method and pass a URL or just a file path and name to this method and it opens on my machine during development just as I need it to do.
The .PDF, .TXT, .XLS etc., etc. files will be on a remote server and not on the client's machine but I want to open the file chosen by the client using the external application like Notepad or Adobe that is installed on all my client's machines.
The problem comes in when deploying this application to the production web server. When we now click on the button/link, it does not open the file/external application on our machines anymore but tries to open it on the production web server. So how do i go about getting the file/external program like Notepad or Adobe to open the file passed to it on my client's machine when running in production?