Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

<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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...