Library tutorials & articles

.NET Applets

Introduction

This is going to be my first tutorial. It's not final, end-all, documentation on this subject. But it is what I have gotten from Channel9 discussions and online documentation. It will walk you through setting up a .NET Applet.

First of all, what is a .NET Applet? An Applet is basically a small application hosted in a larger application, in this case, the browser. Most common are Java Applets, but they are not the only ones. Items in the Windows Control Panel are called Control Panel Applets. .NET Applets are called that because they resemble Java Applets, but that is not their official name. Generally, the procedure I am about to describe is called ' Hosting Windows Forms controls in Internet Explorer '.

How do you create a .NET Applet? Very basically, you create a Windows Forms user control. That's right, you write Windows Forms code and your browser (Internet Explorer only) handles it. Then you put an <object> tag into your html and specify some information about the Applet (the dll file, namespace, and class).

How does this work? Well, Internet Explorer is able to run .NET controls probably by using COM to host mscoree.dll (If you know more, let me know). If the user/client has the .NET Framework installed, and Internet Explorer 6.0 (I am not sure of 5) your user control will simply be gobbled up and used as a local control.

Security

'Whoa! What is Microsoft doing to us? Think of the hole this could open up!!!', you say. Calm down. It runs in a ‘sandbox'. A special zone that limits what the control can do. It won't let you access local files with the exception of the OpenFileDialog box, and then can only use the dialog box's OpenFile() method. You cannot use the SaveFileDialog. So you don't have to worry about some one messing with your hard drive. (To see which permissions an assembly has for all the different zones, you can go to Control Panel/Administrative Tools/.NET Framework 1.1 Configuration, and then under Runtime Security Policy/Machine/Code Groups/All Code.)

Comments

  1. 01 Feb 2007 at 14:39
    Wath about the interaction of the hosted control with the Javascript? 

    i saw that developing the control in .net 1.1 framework is it possible... but using 2.0 i got some truble...

    do you have more news?!?





  2. 02 Apr 2005 at 03:45

    Very nice and concise. Good work M!

  3. 01 Jan 1999 at 00:00

    This thread is for discussions of .NET Applets.

Leave a comment

Sign in or Join us (it's free).

M Kenyon
AddThis

Related podcasts

  • More jQuery in ASP.NET

    In this episode Chris Brandsma, Rick Strahl, Dave Ward, Bertrand Le Roy, and Scott Koon conclude their discussion of Microsoft's jQuery in ASP.NET announcement1.This episode of the Alt.NET Podcast is brought to you by LLBLGen Pro, the most mature O/R mapper and code generator out there.Are ...

Events coming up

  • Nov 18

    15 Minutes of Fame

    Dresher, United States

    This is a yearly tradition. We select 10 of the favorite speakers from monthly meetings, code camps, and hands on labs. Each one does a 15 minute talk on their favorite .NET technology. This is our 10th anniversary so we plan a gala event with special prizes and refreshments.

We'd love to hear what you think! Submit ideas or give us feedback