Fog Creek Software
Discussion Board




Running .Net code on the client browser?

Is it possible to do this?  For instance, I can make an ActiveX UserControl in VB6 and then include it in a page as an OBJECT tag. 

Also if running in an HTC or in a Trusted Zone with the right permissions, I can use CreateObject() or new ActiveXObject() to create an instance of an object that lives in a DLL.

Another technique is making Binary Behaviors*.

Can you do any of this in .Net?

*http://msdn.microsoft.com/workshop/browser/behaviors/howto/binbehaviors_ovw_entry.asp?frame=true

Wayne
Wednesday, June 23, 2004

WinForms controls can be embedded into IE/Win as long as the end user has the .NET runtime installed. As memory serves, they basically work just like ActiveX objects, except that they run in a very limited sandbox.

Brad Wilson (dotnetguy.techieswithcats.com)
Wednesday, June 23, 2004

According to this page:

http://samples.gotdotnet.com/quickstart/winforms/doc/WinFormsIeSourcing.aspx

"The HTML page must reside in an IIS virtual directory on your web server, and have appropriate permissions. In this example, the Windows Forms control resides in the same directory, but it can also be installed in the global assembly cache. Execution permissions on the virtual directory must be set to scripts -- the control will not be properly activated if the execution permissions are set to scripts & executables. For this sample, these steps have been performed for you."

My question is, what does IIS have to do with a DLL that runs in the client?

Wayne
Wednesday, June 23, 2004

probably something to do with the file being foo.dll -- if you set the execution privlidges to scripts & executables, it'll probably try to execute foo.dll instead of serving it as data.



another alternative is to use com interop and run it as an activex control.

mb
Wednesday, June 23, 2004

So, if you can make a COM DLL with .Net, then you can use CreateObject() and make the Binary Behaviors too.

That's cool.  I wonder how much of a performance hit there is though.

I have seen very few examples of "fat" client-side .Net objects that run in the browser. Seems to me that this would be popular among the corporate developers.

Wayne
Wednesday, June 23, 2004

*  Recent Topics

*  Fog Creek Home