locked
WebForms or MVC - an ASP.NET rookie in trouble RRS feed

  • Question

  • User25990494 posted

    Hi,

    I'm quite new to ASP.NET. Nevertheless I have to develop a quite complex project under the following requirements:

    - extensibility

    - high security

    - of course proper functionality

    - reusable elements / templates, i.e. same structure for object list display and edit view.

    I've already developed a small application with WebForms but after reading almost every chapter of ASP.NET Unleashed by Stephen Walter I'm getting the feeling that I don't know anything about ASP.NET at all since it's so complex and huge.

    I don't know anymore which technique or control fits best for my idea of reusable elements since I have to many different ways of doing it in my head. To get my reusable elements done, I created some Custom Controls but I'm not sure if it's better to solve it using FormViews or Master-Detail-View ...

    The other question is: shall I use DataSets or EF or Linq to SQL ...

    Argh, my brain is exploding! ;)


    Since I used to be a PHP programmer making a lot of use of OOP techniques I really like to write my own source code, JavaScript (using jQuery, Ajax and JSON) and CSS.

    Actually I included a lot of CssClass into my first WebForm project as well as some Ajax stuff using jQuery without making use of the .Net Ajax stuff. Furthermore I developed my own custom provider with my own database. So I'm really trying to keep control over my application.

    My question is, does anyone think that MVC might help me getting my braincells into the right direction again? The problem is that I spend a lot of time trying to get this WebForm concept into my head but I'm still thinking I'm right at the beginning.

    Now I fear running out of time trying to grasp the MVC approach not knowing if it might fit better in the end.

    So do you think that MVC is easy to grasp and control?

    I've already seen the Nerddinner video by Scott Haselman and I really loved the approach. Nevertheless I also like the Master-Detail-View possible with WebForms and I'm not sure if it is possible to realize it with MVC because I would like to have the EditView on the same site like my list.


    Sorry, this was a lot of text but I'm really going crazy right now with almost 2000 pages of ASP.NET Unleashed in my brain and some confusing information I got from different Forums saying that ViewState, PostBack and Datasets are bad and Events hard to handle.

    Furthermore please don't blame me for some weird expressions, English isn't my mother tongue. ;)


    Thanks for any reply

    Ecard

    Monday, March 15, 2010 6:38 AM

Answers

  • User-590788913 posted

    Since you mentioned you came from PHP background, I suggest you just forget about the WebForm, go straight to MVC. MVC is a subset of ASP.NET, what you still need to learn about ASP.NET are:

    - HttpModule mainly to do with routing and security context
    - HttpHandler where MVC is actually a handler
    - concept of how web request/response being handled by ASP.NET

    You can ignore the follow:

    - page life cycle
    - page events
    - custom/user controls
    - ASP.NET AJAX library as you can easily find jQuery libraries doing essentially the same thing

    Instead of the book you are reading on the webform, I recommend this book instead: http://www.amazon.com/Professional-ASP-NET-MVC-Wrox-Programmer/dp/0470384611/ref=sr_1_3?ie=UTF8&s=books&qid=1268663458&sr=8-3

    Bottomline is that given your situation, go with MVC without knowledge of WebForm will be lot easier for you.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 15, 2010 10:35 AM
  • User-952121411 posted

    Well I will touch on some of the points of ASP.NET web forms if you decide to stay the course with that technology, since others have discussed the advantages of ASP.NET MVC (which by the way 2.0 was just released! http://weblogs.asp.net/scottgu/archive/2010/03/11/asp-net-mvc-2-released.aspx).  I have not programmed in PHP, so I am not sure which one is more similar in nature, but others have stated MVC.

    I understand your frustration with the massive amount of technology wrapped around ASP.NET.  This is in part because you are working with something that was released roughly 10 years ago, and a lot has been packed into it. You have a difficult recipe being compiled: build an advanced/complex application using technologies you have never used, and then add a time limit obviously.  The good news is, you have already spent the time to learn ASP.NET to some extent, so if you go that route you have a decent start.  

    By your decription you are not a beginner programmer overall, but new to the web platform in .NET. Typically the entry level route for understanding the basics of ASP.NET is to use ADO.NET objects (DataSets, DataTables, etc.) to get data from the DataBase, wrap/map that data into objects, and use basic ASP.NET controls that can bind to your objects directly.  You can actually expand on this method applying different design patterns to make a scalable application.  So the best balance for your situation, might be to use the basics of ASP.NET like raw ADO.NET and web controls combined with your more seasoned knowledge of OOP to apply a design to make your application more scalable.

    Actually I included a lot of CssClass into my first WebForm project as well as some Ajax stuff using jQuery without making use of the .Net Ajax stuff. Furthermore I developed my own custom provider with my own database. So I'm really trying to keep control over my application.
    .

    The above is one area you might want to break an old habit.  I see this often from many developers that come from a background of working with low level languages; the tendency to want control over everything to the point of not learning new methods that will help you develop more rapidly equating to a better application with more functionality.  Microsoft has spent an enormous amount of time into placing functionality into ASP.NET and the .NET Framework to help encapsulate processes that otherwise would take a significant amount of time to do manually.  I highly recommend into using the controls and technologies that will help speed up development and enrich the user experience like the Ajax Control Toolkit, jQuery, Silverlight, Object Data Source Controls (for binding objects to controls like a GridView; saves time from writing all code manually), FormView (in situations where large data entry screen exist), Master Pages, etc.  These are a sampling of controls and technologies (not all by any means) that will help speed up the development, rather than needing to have 'control' over everything.  To set some bounds, let me state it this way... the minute you attempt to make a raw API call for functionality that is already wrapped up in a .NET Framework namespace; step back and make sure you are not taking 'control' of something that can be done much easier.

    My advice - tackle the basics in either ASP.NET web forms or MVC while applying a good OO design and you should have a solid application and something to build on going forward.

    Hope this helps! Smile

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 16, 2010 9:38 AM

All replies

  • User-590788913 posted

    Since you mentioned you came from PHP background, I suggest you just forget about the WebForm, go straight to MVC. MVC is a subset of ASP.NET, what you still need to learn about ASP.NET are:

    - HttpModule mainly to do with routing and security context
    - HttpHandler where MVC is actually a handler
    - concept of how web request/response being handled by ASP.NET

    You can ignore the follow:

    - page life cycle
    - page events
    - custom/user controls
    - ASP.NET AJAX library as you can easily find jQuery libraries doing essentially the same thing

    Instead of the book you are reading on the webform, I recommend this book instead: http://www.amazon.com/Professional-ASP-NET-MVC-Wrox-Programmer/dp/0470384611/ref=sr_1_3?ie=UTF8&s=books&qid=1268663458&sr=8-3

    Bottomline is that given your situation, go with MVC without knowledge of WebForm will be lot easier for you.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 15, 2010 10:35 AM
  • User-525215917 posted

    Take ASP.NET MVC. It has a lot better interface for programming web apps than ASP.NET Forms that is based on desktop apps model.

    Monday, March 15, 2010 8:53 PM
  • User-1237044210 posted

    Hi Ecard,

    Really regret  to said that "Don't have any way to ignore webform!". Because as me, if you chose ASP.NET MVC, you will wrong because it's subset's ASP.NET. It's still using some primary define from ASP.NET (Session, Authorization, User, Config file, Global.asax,...). If you chose LINQ to SQL or Entity framework you will not understand about basic DSL on ADO.NET. That is reason Microsoft still develope ASP.NET in .NET 4 and try to improve it for better. But if you used to coding in Zen framework or CakePhp (MVC framework in PHP), you will learn very fast in ASP.NET MVC. They have same principles (MVC pattern). But ASP.NET have many extra things in it.  

    Tuesday, March 16, 2010 5:05 AM
  • User-952121411 posted

    Well I will touch on some of the points of ASP.NET web forms if you decide to stay the course with that technology, since others have discussed the advantages of ASP.NET MVC (which by the way 2.0 was just released! http://weblogs.asp.net/scottgu/archive/2010/03/11/asp-net-mvc-2-released.aspx).  I have not programmed in PHP, so I am not sure which one is more similar in nature, but others have stated MVC.

    I understand your frustration with the massive amount of technology wrapped around ASP.NET.  This is in part because you are working with something that was released roughly 10 years ago, and a lot has been packed into it. You have a difficult recipe being compiled: build an advanced/complex application using technologies you have never used, and then add a time limit obviously.  The good news is, you have already spent the time to learn ASP.NET to some extent, so if you go that route you have a decent start.  

    By your decription you are not a beginner programmer overall, but new to the web platform in .NET. Typically the entry level route for understanding the basics of ASP.NET is to use ADO.NET objects (DataSets, DataTables, etc.) to get data from the DataBase, wrap/map that data into objects, and use basic ASP.NET controls that can bind to your objects directly.  You can actually expand on this method applying different design patterns to make a scalable application.  So the best balance for your situation, might be to use the basics of ASP.NET like raw ADO.NET and web controls combined with your more seasoned knowledge of OOP to apply a design to make your application more scalable.

    Actually I included a lot of CssClass into my first WebForm project as well as some Ajax stuff using jQuery without making use of the .Net Ajax stuff. Furthermore I developed my own custom provider with my own database. So I'm really trying to keep control over my application.
    .

    The above is one area you might want to break an old habit.  I see this often from many developers that come from a background of working with low level languages; the tendency to want control over everything to the point of not learning new methods that will help you develop more rapidly equating to a better application with more functionality.  Microsoft has spent an enormous amount of time into placing functionality into ASP.NET and the .NET Framework to help encapsulate processes that otherwise would take a significant amount of time to do manually.  I highly recommend into using the controls and technologies that will help speed up development and enrich the user experience like the Ajax Control Toolkit, jQuery, Silverlight, Object Data Source Controls (for binding objects to controls like a GridView; saves time from writing all code manually), FormView (in situations where large data entry screen exist), Master Pages, etc.  These are a sampling of controls and technologies (not all by any means) that will help speed up the development, rather than needing to have 'control' over everything.  To set some bounds, let me state it this way... the minute you attempt to make a raw API call for functionality that is already wrapped up in a .NET Framework namespace; step back and make sure you are not taking 'control' of something that can be done much easier.

    My advice - tackle the basics in either ASP.NET web forms or MVC while applying a good OO design and you should have a solid application and something to build on going forward.

    Hope this helps! Smile

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 16, 2010 9:38 AM