Tag Info

Hot answers tagged

97

I developed ASP .Net WebForms applications for 3 years, and after one day of doing an MVC tutorial I was sold. MVC is almost ALWAYS the better solution. Why? The page lifecylce is simpler and more efficient There is no such thing as controls besides html controls. You don't need to debug your output to see ASP .Net is generating. ViewModels give you ...


61

Webforms vs. MVC seems to be a hot topic right now. Everyone I know touts MVC to be the next great thing. From my slight dabblings in it, it seems ok, but no I don't think it will be the end of webforms. My reasoning, and the reasoning as to why webforms would be chosen over MVC, has more to do with a business perspective rather than what one is better ...


55

I emailed Scott Guthrie, an MVC expert at Microsoft. And probably the most qualified man to answer this question. He was kind enough to reply: "Different customers look for different programming approaches, and a lot love WebForms and think it is great. Others love MVC and think it is great. That is why we are investing in both. " So, to me ...


34

I recently switched from using in-line SQL queries to using EF and here's what I've found: Pros Much faster to build the DAL (love not writing the SQL queries!) Much easier to maintain No longer need to remember to parse my input before building an in-line sql statement, which means less chance of a SQL injection attack (of course, it's still possible ...


28

I am a complete and total convert to ASP.NET MVC and have not looked back, that said I do still have to maintain several very large WebForms apps. Here's my take on it: WebForms Use these when you have some serious heavy lifting to do with grids. The grid controls are really very nice when you have a simple dataset that fits nicely in a tabular format and ...


28

Former Designer here, turned Dev, and I used to piss and moan about Web Controls too. Honestly, its MUCH cheaper for a designer to adjust their practices than for a .NET Developer to delve into a custom impelmentation of a GridView because the designer INSISTED that each TD have a 'rel' tag (or whatever). As MainMa very wisely pointed out, the decision to ...


23

This answer is going to get downvoted into oblivion but, on the whole I see WebForms as being for cargo-cult programmers, while MVC is the technology of choice for more seasoned developers who understand the importance of simplicity & maintainability.


14

My experience: Wrote CakePHP projects for one year. Completed a medium sized Webforms project over six months. Worked on a Windows Forms project for three years. After that experience, I tried writing another app using webforms, and got frustrated after struggling for about a day with how webforms attempts to shield the developer from the reality that ...


11

Entity Framework is a productivity tool. Unless you have a good reason not to (E.G. you are on SQL 2000 or have no time to ramp up on the technology), then use the best tools at your disposal. That being said, I find the concept of Entities to translate very well to the MVC pattern's Model. While having a 1:1 relationship with Models and tables is a bad ...


11

Don't be so hasty I know dealing with other people's code really sucks, but you have to take into consideration that 1- you don't know the new MVC platform, and 2- down the road you will be wanting to remake it again. Consider that rebuilding the project also takes time away that you could use upgrading it. No Surprises People don't like surprises in the ...


10

The protocol may be stateless, but the app you write could maintain any state :)


8

This is a stale question with a lot of answers but none had the answer I would have expected to be listed. The short answer is: Use ASP.NET MVC if you intend to properly build a web application with modern programming conventions and industry embraced patterns for the ASP.NET platform. On the down side you will be expected to know how HTML and ...


8

There is a solution to your issues but it involves a design pattern change to MVP. This is an up-front investment of time that needs serious consideration before start. Basically, issues that you are experiencing is not new. In short, you need to introduce a view abstraction through interface that identifies the data model that the view supports. It is ...


7

I prefer webforms because my background is windows development. Speed of developmnt is a key issue, and I can easily pass a problem to someone in india to fix overnight with forms, also, if I have a speed issue on a page, a really good book about asp.net speed is handy ( Rick Kiessig is the man ). webforms is for ex windows people mvc is for web people ...


7

My 2 cents is to always use ASP.NET MVC for new projects if you have the option. In my opinion, webforms is not a good way to develop web apps, period. I think abstracting away basic REST is bad, the entire postback model is bad, the way html/css is handed with a reliance on the GUI editor is bad, the emphasis on stuff like wizards and GUIs to set stuff up ...


7

The problems that I see: Non-standard way of working: you are coming up with your own, fairly non-standard way of working. Any new developers you hire will have to learn the details of your framework. Some of them may not like it (e.g. see some of the comments above), and refuse to work in it. As you go along, you will also keep (re-)inventing lots of ...


7

HTTP is certainly an older technology that has become quite ubiquitous as the web became so. As a result people are extending this technology to do many things now with modern web apps were it can appear the statelessness of HTTP is an issue. Hence you see a lot of conveniences like viewstates. However it is also possible to code modern web apps in a ...


6

In my opinion, converting an application that took years to develop to MVC is probably not realistic. It would probably take you just as long to convert it to MVC, becasue the implementation would be totally different, and you would have to find other ways to implement the existing features. I doubt that this client who regularly asks for enhancements would ...


6

ASP.NET is a framework, which abstracts the generated HTML code. This means that you can't be asked to reproduce exactly a given HTML code in an ASP.NET application, unless you have enough budget to rewrite anything which is generated by ASP.NET controls. It would be up to the stakeholders to decide: either you use ASP.NET controls with their strong points ...


6

Creating new tables dynamically based on user input is usually not a good idea. If the basic structure of forms changes, all the dynamically created tables will need to be updated to include new columns or have old ones removed, and this can cause maintenance headaches. Then there's problem of knowing which table to query (which will probably lead to dynamic ...


6

Please keep this discussion strictly technical and avoid flamewars. We'll see ;) (As Bart van Ingen Schenau points out, your question is a little ranty, which may not help the situation) You're actually referring to ASP.NET Webforms. ASP.NET doesn't suck at all; MVC is great (and doesn't share the problem you mention). You're right that the ViewState ...


5

I've not seen this consideration put forward amongst the existing 15 answers to this thread yet, but I think it's worth considering. From my experience Web Forms is more similar to Win Forms and WPF than MVC is. Given this, I think one might consider choosing Web Forms when the team has most experience in that kind of tech, or when the Web Forms project ...


5

At my last job, the devs would build the application and then would pass it to the designers so that they could make it look like a bunch of software programmers didn't make it. :) When we first started this process, there were a lot of back and forth between the devs and designers. They didn't understand the pages that they were given. Heaven forbid if we ...


5

Webforms was designed in a time when people wanted web applications to look like windows applications. This was a dark time on the internet where developers were forced to learn page lifecycles and deal with horrible view states and 3rd party controls which would cause such bloat the very fabric of the internet would be shaken... That is Webforms, an ...


4

I have read all the answers and feels my personal experience would add something to the answers above. 3-4 years back, I developed 2-3 website projects using Webforms. Around that time, MVC wasn't around or i didn't heard of it. The development was naturally(I was coming from Win-forms development with no prior web development experience) fast for me, ...


4

Another potential solution is to use an alternative Entity Framework Library that is not the one supplied with V.S. There are a few out there on the web. The Entity / 3 layers framework concept, has been out there for a while, and have work with several custom libraries, like many other developers, before Microsoft released its own "official" framework. ...


4

The biggest difference between MVC and webforms is not separation of concerns, but how it handles state. Webforms tries to model desktop application development by working hard to hide the stateless nature of HTTP and the web. In the process a lot of unnecessary bloat in the form of generated HTML and ViewState gets passed around, making pages slowers and ...


4

It is very simple in fact. If your script is not bound to a document ready event, it will fire up instantly, that is, when the page is being loaded, NOT when it has loaded. What it means is that the HTML controls/tags below your script tag have not been added yet to the DOM. And as such, attempting to interact with them will not work. If you place your ...


4

The pattern for the success case: Read POST request Validate POST data Pre-process POST data Store Redirect Read GET request Display success message And in the failure case: Read POST request Validate POST data (if fail, go to 5.) Pre-process POST data (if fail, go to 5.) Store (fails) Display error message In your code, this structure looks somewhat ...


4

ASP.NET MVP pattern is the best architecture for a long term ASP.NET webforms application. It is coming into play with "separation of concerns" concept, which is de-facto a trend behind the MV* patterns. The question on Why to use it? - addressed in details in this post - ASP.NET MVP Getting started with testing an ASP.NET Webforms Application Trade-offs ...



Only top voted, non community-wiki answers of a minimum length are eligible