wrappingduke 0 Newbie Poster

Hello,

I am attempting to use a windows form in asp.net. However, I am receiving the error message:
Unable to cast object to type 'Custom.MyControl' to type 'System.Web.UI.Control'

The following are the steps taken to try to use this Custom control in a web app:

  1. Convert the form to a Forms.UserControl in the windows app
  2. Create a strong name in the Properties page of VS
  3. Compile the form as a DLL
  4. Register the DLL.
  5. Store DLL (i.e. new assembly) in the assembly cache
  6. Add the control to the "controls" tag in the web.config of the web app
  7. Call control from web page, e.g.

    <Custom:MyControl runat="server"></Custom:MyControl>

Is the above feasible?

Any help is appreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.