Hello i was wondering how can i import System.Windows.Forms in my asp.net class file?
It actualy marks it as error with no error suggestions.
Do i need to reference somewere?
Hello i was wondering how can i import System.Windows.Forms in my asp.net class file?
Share
You need to add a reference to the correct assembly to your project in Visual Studio before you can import the namespace.
But I question whether this is a good idea. While it is possible to create instances of the windows forms classes and controls, you cannot add or show any of those controls with asp.net pages.
Some of the Windows forms types have non-visual behavior features you may want to use, and so I have seen this done to good effect in the past. But even then, it’s usually a bad idea, as the Windows Forms controls are also memory hogs relative to the web and can hurt performance of your site. And remember that these controls still won’t keep their state across multiple http requests. There’s almost always a better way to do it.