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:
- Convert the form to a Forms.UserControl in the windows app
- Create a strong name in the Properties page of VS
- Compile the form as a DLL
- Register the DLL.
- Store DLL (i.e. new assembly) in the assembly cache
- Add the control to the "controls" tag in the web.config of the web app
Call control from web page, e.g.
<Custom:MyControl runat="server"></Custom:MyControl>
Is the above feasible?
Any help is appreciated.