Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

System.Diagnostics.Process.Start(...)

  Asked By: Elliott    Date: Feb 14    Category: Asp.net    Views: 3849
  

I am a newbie, trying to build an ASP Web application in VS.NET, with
code-behind in C#. When a user clicks on a radio button, I want to
pop up another Web page showing a picture. The code looks like:


using System.Diagnostics

Process.Start
("IExplore.exe", "http://localhost/allNetRes/photos/rowboat.jpg");

The project files are in c:/inetpub/wwwroot/allNetRes/*.aspx, and the
photos are in c:/inetpub/wwwroot/allNetRes/photos/*.jpg.

It doesn't crash, it just doesn't do anything. I can step through
the code with the debugger, and it takes the correct path, including
the Process.Start() line, but the new Web page never appears. When I
click on the above URL (in the VS IDE) it finds the *.jpg file and
displays it in the VS edit window.

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Pravat Jainukul     Answered On: Feb 14

You click the radio  button and that sends a message to the server, the
Process.Start occours on the server NOT on the client machine.

Ok, you figure, if your on localhost then server/client are one machine .... so
it should start  the process.

Well, it might, if you gave the correct  server folder permissions admin
authority execute etc.

But as soon as the code  is put onto a server somewhere else - they will
definately NOT gve you permissions to start running processes on their machines.

It will however work in a Winforms app locally - which you could embedd into a
web page, send to the client and, using interop(again with permissions) access
the client computer and open anything from IE to Word.

 
Answer #2    Answered By: Rocco Anderson     Answered On: Feb 14

But this is exactly what examples on MSDN and elsewhere claim it should
do. It should start  the browser (explicitly requested in my code,
without specifying the browser it starts the default browser) and gives
it the URL and it should fly.

 
Answer #3    Answered By: Scott Simmons     Answered On: Feb 14

It will(should?) start  the default browser, with that image as a parameter.
But it would do it on the server.

What URL on MSDN shows this as an example for ASP.NET ?

Doing it client-side, put this in Page_Load:


RadioButton1.Attributes["onclick"] =
"javascript:window.open('/allNetRes/photos/rowboat.jpg')";

 
Didn't find what you were looking for? Find more on System.Diagnostics.Process.Start(...) Or get search suggestion and latest updates.




Tagged: