473,414 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Launching pdf file with Process.Start does not work

Hello,
I am trying to launch a pdf file from and C# .net page. Through previous postings on this site and others, I found that using System.Diagnositcs.ProcessStart should be able to do this for me. However, although everybody else on the discussion pages round about manage to do this, my page does nothing when I call this function. Anybody knows what might be wrong? Could it be some setting i Web.config missing, wrong, etc?
....
<%@ import Namespace="System.Diagnostics" %>

<script runat="server">

void Page_Load(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("C:\\Test.pdf");
}
....

Web.config file:
<configuration>
<appSettings>
</appSettings>
<system.web>
<compilation debug="true"/>
<customErrors mode="Off"/>
<pages theme="FyrrTheme"
enableEventValidation="false"
compilationMode="Always"
maintainScrollPositionOnPostBack="true"
asyncTimeout="450">
<namespaces>
</namespaces>
<tagMapping>
</tagMapping>
</pages>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="640"
/>
</system.web>
</configuration>

Best regards
Kurt
Jul 2 '07 #1
2 1398
shweta123
692 Expert 512MB
Hi,

Is there any specific need for calling Process.start?
You can try Response.Redirect instead.Also please check if process is created in Task Manager.It may happen that process is running in the Background and not seen on the screen.
Jul 2 '07 #2
Hello,
shweta123, but why not, of course. I just assumed that redirect would not work with pdf.... foolish of me :-)
Thanks now it works. :-)
Jul 2 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: James N | last post by:
PROBLEM # 1: ----------------- I am trying to launch a website in IE on the server from a C#/ASP.NET web service. I am using the System.Diagnostics namespace and the Process class methods. The...
0
by: Scott Zabolotzky | last post by:
I'm using the following code to launch SIGNCODE.EXE to sign a CAB provisioning file from an ASP.NET app. When I run the code the exit code comes back as -1. I have not been able to determine what...
2
by: VJ | last post by:
I have the option "Reuse windows for launching shortcuts" checked in my IE. Now in my client code on a click event of a link, I do the following, Dim procWebPages As Process Dim strWebPageLink...
2
by: andreas | last post by:
hi, In windows xp in the start launch menu when i put notepad "c:\test.txt" i get notepad with test.txt in it. in vb.net when i state system.diagnostics.process.start("notepad.exe" i get...
24
by: Alan M Dunsmuir | last post by:
What is the command (in Windows Forms VB.NET) which will cause the subject computer's default browser to launch, and display a specified Web page? -- Alan M Dunsmuir
8
by: Keith French | last post by:
I am trying to launch an external program within Visual Basic 2005 Express. If it is a simple program it works well with:- myProg = "C:\MyFolder\MyApp.exe"...
0
by: ee_stevek | last post by:
hi guys, here is my problem: i have to maintain a web vb.net application developped some times ago. The application was developped on Windows2000 SP3 with Visual Studio 2003 (7.1). and the...
0
by: spamfilteraccount | last post by:
Hi, I have simple GUI with a listbox containing file names. If I select a file and press ENTER it should be opened. It works, but things are working strangely. Here's the code I use to open...
1
by: =?Utf-8?B?TWFyayBIb2xsYW5kZXI=?= | last post by:
Hi All, I am trying to launch an application based on the extension just like windows explorer does, specifically with regards to templates. For example, 1. When you double click on a word...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.