Windows Forms In Internet Explorer

J

John Smith

Hi folks,

I'm embedding a Windows Forms User Control into an aspx web page. I've
created the class library in C# and added the user control to it.

If the control just has simple Windows Forms Controls (like TextBoxes or
Buttons), it works fine. IE treats it wonderfully

If I do something a little more advanced though (like connecting to the
Outlook Object Model in code, or embedding the Web Browser Control...), then
it doesn't work. It will work while debugging through Visual Studio, but if
I open the site outside of Visual Studio, then it just gives me a blank box
where the control should be.

Is there anyway to overcome this? This is for a local intranet, so I can
have changes made to the local security policy of the client PCs if
neccessary. Right now though, I'm not sure what the solution is. Do You?

Thanks!
 
J

John Smith

Woops...Sorry take that back. The first few times I went to that site, that
is what I got, but then eventually it started displaying. I guess it was
still downloading or something.

Not sure how to overcome that either...but at least it's working for now.
 
B

Bruce Barker

a couple issues:

1) .net code hosted by IE runs in a security sandbox. to access outlook (or
call unmanged code like a com object), the users must mark your assembly
trusted (see caspol.exe).

2) it takes a while for IE to spinup a windows forms user control, it must
load the .net vm, jit the control, etc . this can take up to minute or two
depending on the assembly.

3) the user must have .net framework installed

-- bruce (sqlwork.com)
 
J

John Smith

Darn...The first link requires a subscription to get to it. Did it say
anything beneficial related to the security restrictions? The other link
just mentioned making the site a Trusted Site which I did.
 
J

John Smith

Cool. Thx. I couldn't run the Outlook code without getting a security
exception error. I used caspol (actually mscorcfg.msc) and got it
working...at least I got working from the dev machine which also hosts the
site. Next test will be accomplishing this from the client machine, and
then deploying the security policy to all client machines.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top