How to host Windows Form in IE

Source: Internet
Author: User

If you've ever used Java to develop a Web application, you're sure to be familiar with Java applets, a small program that basically runs in a browser. When the browser loads HTML code that contains the Java applets flag, the Java applets executes, and Windows Forms controls in the Web page run the same way as Java applets. We can use the rich classes provided by Windows Forms technology to develop Windows Forms controls and then deploy them in a Web page that executes code contained in Windows Forms controls when the browser loads those pages.

. One of the great places of net is its seamless integration with IE. For example, we can even activate a Windows Forms control from IE without the user knowing it. Although all the functionality of the code Access security provided by the. NET CLR is exploited, this is done without registering.

When you develop the Windows Forms control, we inherit all the functionality that is provided by the Windows Forms class. For example, we can use the Windows Forms Control validation technology to make extensive validation of the data entered by the user, and, similarly, we can invoke a remote Web service from a form control. By using all of these technologies, we are able to use them. NET platform to develop rich and powerful applications.

Realize

In this section, we'll learn how to create a simple Windows Forms control and host it in IE. Here are 5 steps to activate Windows Forms controls in IE:

• Create Windows Forms controls.

• Create an HTML document that contains the object flags that identify the Windows Forms control.

• Configure the virtual directories that are required to properly activate the control.

• Configure code access permissions.

• Run the control.

Let's go over each of these steps in detail.

Creating Windows Forms Controls

In this step, we will create a simple Windows Forms control that displays "Hello World" information to the user. We will first create a new Visual C # Windows Control Library project named Helloworldcontrol, as outlined in the administration.

Once the project is created, we will rename the default user control to Helloworldctl. We will add a Label control named Lblmessage and a button named Btnclick on the user control. When the user clicks the click button, the program executes the following code, displaying a simple message to the user:

private void btnClick_Click(object sender, System.EventArgs e)
{
 lblDisplayMessage.Text = "Hello World";
}

Now that you have created the control, let's compile the project and create the executable code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.