logo
  • Home
  • My Works
  • Downloads
  • Personal
  • Guest Book
  • About Me

Windows Controls in Internet Explorer

Published by Rafeeque B Muhammad on Monday, January 25, 2010 12:00 AM
Updated on Monday, January 25, 2010 12:00 AM


I will explain the steps to create a web application with windows controls. I think it would more interesting if you can do all the windows things in browser. Don’t think it will support all the WinForm’s features in IE.

Important Notes:

·         We should create user control’s, we can replace only the user controls in IE.

·         It will work only in IE, it doesn’t support any other browser

·         It should installed the .NET framework in the client machine

·         Site should be trusted site list in browser.

·         Bowser should allow downloading the files from trusted sites.

 

 

Steps to create one sample:

1.       Create a Solution

2.       Create a Web Application. Please note we should create the web application in IIS. If you are creating the ASP.NET Web application then you have to change the path to web server. Go to the project properties and change the location. If you are using Visual studio development server you may face a lot issues like fusion binding error, modified changes don’t reflect..

3.       Create another windows class library project and place some windows controls here (MyFirstUserControl).

4.       Just add some code in user controls (eg.)

 

 public partial class MyFirstControl : UserControl

    {

        public MyFirstControl()

        {

            InitializeComponent();

        }

 

        private void btnMyFirstApp_Click(object sender, EventArgs e)

        {

            MessageBox.Show("Hi, This is my first windows calendar application in browser");

        }       

 

5.       In Web application create one folder (here I have given name “WindowsControls”)

6.       We need to place the output of wincontrols project to the Web application’s WinControls folder, instead of adding the reference. We can do this manually all the time; also we can use the Visual studio feature for this. Go to the class library project properties ->Build change the output path (..\WebApp\WinControls5\).

7.       We need to place the windows user control into the Web page using Object tag, samples given below. Important thing need to make sure that the classid (DLL’s physical location#namespace of user control).

<object id="rtfcontrol" height="472" width="488"

         classid="WinControls/WindowsControls.dll#WindowsControls.MyFirstControl" viewastext>

     </object>

8.       Rebuild the solution and run the web application. You can see the window calendar control in IE now. J

9.       If you are using any other assembly as a reference in the user controls that we should place in the same folder (WinControls). Look this example here I have created DataAccessLayer and user control will call one method from this which is GetMessage(). Our case it is not required to copy anything; once we will add the reference it will copy the output files into this specific folder.

10.   You never see the files in solution explorer by default, you need go to the Show all files option and include files whatever you need. But this is optional; we already mapped this folder in IIS.

Technical Articles

  • All
  • .NET Framework
  • ASP.NET
  • C#
  • Win Forms
  • WCF
  • SharePoint(WSS 3.0)
  • SQL Server
  • TSQL
  • Oracle
  • PL/SQL
  • Performance and Tuning
  • Application and Tools
  • Outlook programming
  • HTML/HTML5/XHTML/DHTML/JAVAScript/CSS
  • Windows Services
  • Web Services
  • Security
  • Web
  • General
  • Architecture

Technical Books

  • All
  • C# Threading
  • WCF

Other Links

  • Important Links

Techies Craft © 2014 | Privacy Policy