Convert .NET Application to a Web Form

Posted on 2006-05-01
Last Modified: 2010-04-17
I am trying to convert a .net Application to a webform.  Is there an easy way to do that?
Question by:tobey1
    LVL 1

    Accepted Solution

    You need to give more details. I assume you have a Windows Forms Application that you wish to covert to ASP.NET, if thats it, you can share the main logic but you can't convert a Windows Form to a Web Form.
    LVL 5

    Author Comment

    That is correct.  I have a windows form that I want o turn to a web form.  If that is the case, man, that means a lot of design work.  I noticed that there are things that I did with the Windows Form that I cannot duplicate with a web form, thus the need to convert the entire project.
    LVL 1

    Expert Comment

    Have you ever heard about 3-tier? Well, this is how it works:

    1rst tier - DB Access Layer (DAL)
    2nd tier - Logic
    3rd tier - Presentation

    This means that in the DB access layer you place the code to interact with the db, that is, no SQL, connection strings, etc... in the other layers. The Logic, or Business Logic Layer, if the logic of you application. And finally, the Presentation Layer is your UI.

    There are some advantages and disadvantages implementing this. First the disadvantages. Hard to learn, you need to read and research a lot to do it well (but you can get there with experience, and don't bother to try doing it all good in the first tries), and sometimes it envolves a litle more code. The advantages are many and all welcome, just a few:

    1. Abstraction - if you need to migrate to another db, for instance SqlServer, MySql; Oracle, you don't need to touch in the Logic or Presentation Layer
    2. You can have multiple "versions" for each tier, that is, you can have one dll with MySql support, antoher with Sqlserver, etc... and in this case, yet very common, you can have several instances of the presentation layer. Since the logic is all separeted you can easily have a Console, Windows Forms, ASP.Net, Pda, etc... versions.
    3. The tiers can be phisicly separeted. Using WebServices or something else, you can place the DAL next to SqlServer, the Logic in another Server, ASP.Net on another and the Windows Forms version on the clients, yet both ASP.NEt and Windows Forms versions could be using the same WebServices.

    So, I hope that since you have to refactor some of your work, you take some time analysing and doind things right :)
    LVL 19

    Expert Comment

    Alexmipego is correct. That is indeed the best way to refactor your application. If you did not design it 3tier in the first place now is the time to do it. You can probably go for a quick and dirty copy to a webform and have most of the functionalities in it, but as soon as change requests come in you'll be a lot faster (and cheaper) when using the 3-tier/n-tier setup.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    This is about my first experience with programming Arduino.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now