Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 27, 2009 04:45 AM by abhitalks
Nov 17, 2008 09:16 AM|LINK
Both WebForms and MVC are just options. if you feel WebForm is more comfortable, use WebForm and use MVC if it is right for you.
Nov 18, 2009 12:37 PM|LINK
Here is my experience with a specific application. I am trying to decide which development platform to use (web forms or mvc). Here are the requirements.
1. Maintain Existing Functionality of Classic ASP application
2. Use Existing Database Objects
3. Add Localization and Globalization
4. Use metadata to define data object bindings between the forms and the database. Cannot use Linq to SQL or Linq to Entities to build the metadata or the database interface.
5. Have one form or view that enables all database objects to be created, displayed, and updated. That means I have one controller and one view for all database objects that require persistence. This view uses the metadata to render the form's html controls
dynamically. The metadata defines the db persistence bindings as well. We have to do this or we will have a hundred or more controllers and views.
6. Build three tiered menus dynamically using database configuration that is based on roles. These menus have to be updatable and dynamic in case we add features in the future.
7. Support standard ASP.Net authentication and authorization.
Problems with MVC:
1. I have to use a querystring to define the selected menu options because the routing is short-circuited by the generic controller/view requirement. This is ok because SEO is just not that important in my application.
2. In order to maintain existing functionality I have to use existing web forms controls (spellchecker, spreadsheets, etc) because similar controls do not exist in MVC. If I do this, and I can, then I have ViewState and code behind, defeating another design
goal of MVC.
3. Unit testing adds significant cost to the effort. Unit testing is great, but I don't have the budget for it. I'd love to do this though.
4. Ajax postbacks that update a div tag on the page and that generate an exception display the error page inside the div tag instead of loading the complete error page. I can code myself out of this issue, and it would be an issue in other platforms, but
I don't have this issue with web forms.
5. No, multi-lingual, client-based, validation controls. In fact, I have to develop two solutions in order to validate a form on the server side and the client side. Remember, my solution has to be localized.
that updates the window's location for example). This is important for the login page and the commerce areas.
So I feel like I'm trying to squeeze my application into this design pattern. Is anyone else having these kinds of issues?
Nov 18, 2009 12:57 PM|LINK
the logic or controller components are still trapped in the web domain and are not re-usable outside of that domain. They depend on global.asax settings and run under iis http. Therefore, there is no re-usability of this component
outside of the web site… You could not for instance, make use of that logic in a winforms application or service.
(a) I am using ASP.NET MVC applications for both Internet and Intranet
where this is appropriate. One application for two domains.
(b) assuming by the "logic component" you mean the Model, much of it is reusable for desktop applications assuming that the developer is building her/his black boxes with proper consideration.
Nov 18, 2009 04:06 PM|LINK
Equation is much simpler than we think dudes! those folks programming in both win and web prefer web form because of drag and drops , evens , and hiding the http and its stateless nature in web from but those folks focusing on web developing (including me)
not only hate viewstates and code behind and dealing with events but also they waiting for a framework like ruby on rails coming out from Microsoft for a long long time ago because they want more control around their HTML and don’t want to look for the
magic events in a datagrid to show some colorful data in their rows!
Nov 18, 2009 04:27 PM|LINK
... folks programming in both win and web prefer web form
Likely an over generalization. I can work in both. I prefer ASP.NET MVC.
Nov 27, 2009 04:45 AM|LINK
ViewState, ControlState, MyState, YourState... are not as important as the "State-of-your-mind".
You can write a complete webforms application without using these "states" at all. Just disable viewstate and go run. Write a good DAL and BLL and top it up with clean aspx with only presentation logic. Use as much of HTML controls as you can and stay away
What do you have now with you, is nothing but an MVC pattern developed out of webforms (of course sans REST but you can have that too if you wish to work more). Accessibility and graceful degradation is another topic another day. MVC is a pattern. It is
a state-of-mind. An approach. Nothing more. MS ASP.Net MVC is a framework which just makes this work easier. And cleaner. A tool.
it contributed to the web we know of today."
Similarly, go stick to webforms if you feel comfortable with it. You can still do wonders with it. Use MVC vice-versa. It all depends on what you want to achieve and how. They are all just tools. You are the craftsmen. Right tool for right hands. Yet...
A razor in a monkey's hand could be dangerous. Or who knows, it might not be!