Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Windows Forms application into Asp.net

I am asking about the best tool that you used before to convert a c# windows forms application into asp.net? I already googled about this topic and found alot of tools but I want someone to recommend the best one based on his usage.

like image 581
Ahmed Avatar asked Nov 28 '22 00:11

Ahmed


2 Answers

I really wouldn't recommend using a tool to do the conversion. Web applications and WinForms are fundamentally different, and should be designed differently. Even with the vast amount of Ajax kicking around these days, you still need to bear in mind the whole stateless HTTP model.

If you don't want to rethink the application, you might want to look into converting it to Silverlight 2.0 instead...

like image 159
Jon Skeet Avatar answered Dec 11 '22 22:12

Jon Skeet


@Jon Skeet has the best advice. That said, let's examine the results of the Google link you provided. What would happen?

The majority of the on-topic (for the query) results are other programmers asking essentially the same question -- and getting essentially the same answer. Indeed, I only see one tool for this: A sample from CodeProject. In this tool, not only are the generated UIs barren and ugly, but there is the following big disclaimer:

Please note that it is not the intention of this article or the accompanying code sample to achieve a complete conversion between Windows Forms and Web Forms including all events and business logic. Due to the fundamentally different nature of the two programming models, this would be a fruitless attempt. Rather, we are targeting the user interface components themselves, mapping Windows Forms controls to appropriate Web Forms counterparts.

And therein lies the real rub: All it's doing is generating a (very rudimentary) UI based on your existing UI. All code, logic, flow and even navigation is up to you.

Bottom line: The reason there's isn't a tool that pops up front and center is because such a tool would be nigh-impossible to write, and would churn out (most likely) un-navigable, non-functional sites. While WinForms and WebForms, programmatically, look similar, they are actually quite different under the hood. No tool will be able to generate an entire site for you from nothing but a WinForms app -- the models are more dissimilar than they might appear.

At the end of the day, the best way to take a WinForms app and web-enable it is to have written said app such that all the business logic is encapsulated in its own DLL (or set thereof), and use those DLLs to drive the back-end of a new-from-scratch site. That way all you're developing is the front end and display support.

like image 45
John Rudy Avatar answered Dec 11 '22 22:12

John Rudy