Launching IE from ASP.NET page, Can it be done?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Help, why won't the following code work (taken from an ASPX page).

//begin code
private void btnCapture_Click(object sender, System.EventArgs e)
{
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorerClass();
ie.Visible = true;

//some more operations
}
//end code

Can I not launch IE in this way? why not?
 
Hi,

why would you ever launch IE from ASP.NET Page?

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

message Help, why won't the following code work (taken from an ASPX page).

//begin code
private void btnCapture_Click(object sender, System.EventArgs e)
{
SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorerClass();
ie.Visible = true;

//some more operations
}
//end code

Can I not launch IE in this way? why not?
 
IE is launched in the aspnet's desktop :). If you really want it to show up,
u'll have to do the following:-
1. Add impersonate the identity to run ur application to the user logged on
to a desktop.
2. In the services configuration(services.msc), mark IIS to be able to
interact with desktop.

Abhijeet Dev
 
The best way to do is to render the whole page as IE does... you should not
try to open internet explorer from a web application/service on server side.
You can use GDI+ to render the page in a bitmap and then send the bitmap
woth ur response.

Abhijeet Dev

Naeem S said:
I've got a ImageGenerator class, it contains the Navigate(URL) function,
the function creates an instance of IE and takes a screen shot.
I'm trying to create capture webpages as images, I know about the
ThumbnailGenerator at GotDotNet but I wanted to create my own C# version.
 
i m talking about "World Wide Web Publishing" service, launch services.msc
from run prompt, check the properties of "World Wide Web Publishing", ->
Logon Tab -> Logon As : Local System Account -> check the box with caption
"Allow service to interact with desktop".

Add <identity impersonate="true"... to ur web.config and impersonate to the
logged on user account. and keep the user logged on to that desktop while u
r running the service.

Abhijeet dev
 
Back
Top