Windows Forms Control on an ASP.Net Page

Pizzor2000

Newcomer
Joined
Jul 12, 2004
Messages
11
Is it possible to get a Windows Forms UserControl onto a web form in an ASP.Net project?

I am using C#. My solution has an ASP.Net Web Application, which I am naming CtlTest. I also added a Windows Control Library, MyCtl, to this solution. I added a UserControl named MyTestCtl to the control library.

I used an <OBJECT> tag to place the control onto an ASP.Net form, as below:
Code:
<form id="Form1" method="post" runat="server">
   <object width="100" height="100" id="someControl"
     classid="bin/MyCtl.dll#MyCtl.MyTestCtl" VIEWASTEXT>
   </object>
</form>

With this code, the page builds and runs without an error, but the control appears only as a grayed-out text box. Am I doing something wrong, or are there special measures which must be made on the control to be available on a web page?
 
Back
Top