Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
Im migrating a winform projecto to a web application project
This winform project has some classes that call some methods of the winform class

In the Web application project, I have to put my classes into app_code folder, but now they cannot instantiate the winform class.

Is possible to call a class that is outside of app_code ?
What could I do?

Thanks
Posted
Comments
ZurdoDev 31-Mar-14 13:28pm    
Yes it is possible. You just need to make sure it is public and use the right namespace. Although, the web and windows are so different that you will likely need to redo most of the code.
memd24 31-Mar-14 13:35pm    
Thanks your help. I adde to all mi App_Code classes the same namespace that has mi Aspx class, but steel not working. should I try something else

1 solution

"have to put my classes into app_code folder, but now they cannot instantiate the winform class."

No, you can't - you cannot use Winforms forms or controls in a web application: if you could, they would display on the Server not the client, which would seem to work in development, but would fail completely when it got to production.

You can migrate the Business logic and it's classes over, and probably the Data logic (with a few changes to connection strings as so forth) but the Presentation layer is a complete re-write: the two systems do not work in the same way at all.
 
Share this answer
 
Comments
memd24 31-Mar-14 14:18pm    
My problem is not whit controls, is migratin the classes, The person in the company who did the winform application used only clases whitnot order. Thats why im trying to make it work
OriginalGriff 31-Mar-14 14:28pm    
Then you have no choice but to go through it with a fine tooth comb and manually change pretty much everything - you can't just "dump it in app_code" and expect it to work, it won't. And I know of no good converter than can help you.

Sorry if this isn't the news you want, but that's life sometimes, I'm afraid!
memd24 31-Mar-14 14:43pm    
Well, the good is that now i know it, the bad is that I have to move all the code =/
Thanks man!
OriginalGriff 31-Mar-14 14:59pm    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900