Click here to Skip to main content
12,456,128 members (52,242 online)
Click here to Skip to main content
Add your own
alternative version


1 download
26 bookmarked

Using Windows Application on web

, 29 May 2006
Rate this:
Please Sign up or sign in to vote.
This article gives you brief idea of how to run your windows application web



This article will helps you to run Windows Application on Web



                Try to use the Microsoft windows control, Avoid third party control.

                Because we are going to use the same control on web




Reduces the coding time and resource needed for web

Bring the desktop to your web





Develop a windows application .For developing weather you can use windows controls

are third party control that’s not a matter.


Process:  "New Project "  select Visual C# Project  and select windows application  and

name the project as  'WindowsTOWeb' and click open (Ref :Figure 1)

Sample screenshot

           2. Design the form as shown in the (Ref: figure 2)

Sample screenshot 


           3. When you run the form the form will look like this in windows (Ref: Figure 3)

Sample screenshot          

4. Now we want to convert the windows application in to a usercontrol to convert the windows

 application in to user control we need to follow the following steps

I> Convert the

                    public class Form1 : System.Windows.Forms.Form


                   public class Form1 : System.Windows.Forms.UserControl

  (Ref: Figure 4)

Sample screenshot

II> Comment the 

                        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

Of the windows


Now your windows form application is converted to user control


5. Now click the property of the project and change the “Output Type" from Windows

Application to Class Library (Ref: Figure 5)

Sample screenshot

6. Before compiling the project comments the "thread" (Ref: Figure 6)



Sample screenshot

Now You have successfully created the user control


7. Now add web application in the same solution it self (Ref: Figure 7)

Sample screenshot 

8. Now create a strong name for your user control by using "sn.exe " which is in the location

'C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin'.The syntax for creating the

string name is

"C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\sn -k "C:\Strongname.snk"

now the strong name has been created and it is in the c: in the name of strongname.snk


9. After creating the strong name specify the path of the strong name in "Assemblyinfo.cs "

file in the [assembly: AssemblyKeyFile("c:\strongname.snk")] attribute


Now the first way of using the user control in the web


10. Now by using the "regasm.exe" create and place the CLSID of your dll in the registry

the exe file which is in the location "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\ ".


11. Then by using the Gacutil.exe register your WindowsToWeb .dll the the registry

 Then go to the registry and search by the name "WindowsToWeb.dll" and copy the CLSID to the

code behind as Specified in the figure (Ref: Figure 8)


Sample screenshot


12. Now you can see the windows control in the web form (Ref: figure 9)


Sample screenshot

13. Run your web application. Congrats your windows control is now on web

Sample screenshot 




            This is the sample application which I have created when I am in position to run

the windows application which I have created on web page. By using this you

can run only the simple application  



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
I am Prabakar working as Software Engineer .I had been working in Microsoft Platform for the past 3+ years.I have also completed MCP.

You may also be interested in...


Comments and Discussions

GeneralCLSID set up Pin
MyDays12-Mar-07 13:07
memberMyDays12-Mar-07 13:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160826.1 | Last Updated 29 May 2006
Article Copyright 2006 by as_prabahar
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid