Mixing ASP.NET with windows forms

C

Chuck Bowling

I have an ASP.NET page with code behind that i'm trying to get to launch a
modeless windows form on the IIS server.

I tried creating a windows form in the web application project and adding a
reference to system.windows.forms. The app will compile with no problems but
for some reason the form won't launch when the method it's in is called.

The next step will be to try and put the form in a class lib on the server
unless someone knows what the problem might be or has a better idea.
 
C

Curt_C [MVP]

Chuck said:
I have an ASP.NET page with code behind that i'm trying to get to launch a
modeless windows form on the IIS server.

I tried creating a windows form in the web application project and adding a
reference to system.windows.forms. The app will compile with no problems but
for some reason the form won't launch when the method it's in is called.

The next step will be to try and put the form in a class lib on the server
unless someone knows what the problem might be or has a better idea.

Are you trying to get the page to launch a windows app on the SERVER?
that wouldnt help the user/client much, especially a Modal one...

But to answer your question, no. You could call an app sure, but you
need to specify the context/user and that may mean it wont "show" on the
console at the server....
 
C

Chuck Bowling

Curt_C said:
Are you trying to get the page to launch a windows app on the SERVER? that
wouldnt help the user/client much, especially a Modal one...

But to answer your question, no. You could call an app sure, but you need
to specify the context/user and that may mean it wont "show" on the
console at the server....

Yes. I want a popup window on the server that notifies the webmaster when a
specific page has been accessed. It's not intended for the client.

I don't have a problem launching a MessageBox on the server. But I am having
a problem figuring out how to do the same thing with a nonmodal form.
 
C

Curt_C [MVP]

Chuck said:
Yes. I want a popup window on the server that notifies the webmaster when a
specific page has been accessed. It's not intended for the client.

I don't have a problem launching a MessageBox on the server. But I am having
a problem figuring out how to do the same thing with a nonmodal form.

Path out the EXE, make sure permissions are set on it, and the folder
for the user that IIS is running under or the context of the call.
 
C

Chuck Bowling

Curt_C said:
Path out the EXE, make sure permissions are set on it, and the folder for
the user that IIS is running under or the context of the call.

Ok... I'm not sure what you're saying here.

Do you mean compile the Form as a separate project and spawn a process for
the executable?
 
C

Curt_C [MVP]

Chuck said:
Ok... I'm not sure what you're saying here.

Do you mean compile the Form as a separate project and spawn a process for
the executable?

You mean you have the Windows form IN your ASP.NET app????
Eeek..
Yeah, put it in a seperate, windows form app, and put the EXE in a place
that you can call on the server.
 
C

Chuck Bowling

Curt_C said:
You mean you have the Windows form IN your ASP.NET app????
Eeek..
Yeah, put it in a seperate, windows form app, and put the EXE in a place
that you can call on the server.

Ok, I'll give it a shot. Just out of curiousity, why the Eeek?
 
C

Curt_C [MVP]

Chuck said:
Ok, I'll give it a shot. Just out of curiousity, why the Eeek?

They run under very different bases, designed for completely different
interfaces and with different "assumptions" (ie root classes).

It's a lot like trying to have your refrigerator cook your food. Sure,
you could probably do it but its going to be a lot easier to just use it
for what it was intended for :}
 
C

Chuck Bowling

Curt_C said:
They run under very different bases, designed for completely different
interfaces and with different "assumptions" (ie root classes).

It's a lot like trying to have your refrigerator cook your food. Sure, you
could probably do it but its going to be a lot easier to just use it for
what it was intended for :}

Hummm... Ok.

What I don't understand is why a MessageBox works without any problem and a
Form control won't. They are both derived from System.Windows.Forms...
 
C

Curt_C [MVP]

Hummm... Ok.
What I don't understand is why a MessageBox works without any problem and a
Form control won't. They are both derived from System.Windows.Forms...

In your case I cant say for certain but MessageBox is calling a
preconfigured base form, not a custom one... that may make a difference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top