|  | 

Programming

ASP.Net Web forms work best for Small Sites


(adsbygoogle = window.adsbygoogle || []).push({});

After months of research, I have finally decided to stick with ASP.net web forms for my web applications for now. I considered moving over to MVC, but I couldn’t find good enough reasons to switch. Web forms can do just anything I want out of the box without a lot of extensions.

While I agree ASP.Net MVC has its place, I feel it is just more bloatware. Web forms are the perfect size for small commercial ventures. To expand my reasoning, let’s look at what people say are the disadvantages of web forms.

Open Project Architecture

Web forms use an open architecture philosophy. Many developers claim this to be a downside. Personally, I say it is an advantage. You have to design your project according to the application it will serve. Web forms let you do that.

Unit Testing

Unit testing is the only place where MVC beats web forms, but most web sites have no need for it. Especially true for small simple sites, the only testing you need online is if the page works as a whole. The modular nature of web forms lets you test new components in relation to code you know works.

ViewState and Page Performance

ViewState maintains page information across reloads of the same page. It’s useful for form elements. It adds extra information to the rendered HTML increasing the size of the page, but the performance dip is minimal if not unnoticeable. You can even turn ViewState off if your application does not need it.

Reusability

Web forms are modular by design. You can reuse code through user controls and master template pages.

SEO

Web form URLs normally go to real ASPX files. If you need to pass data to them, you most likely use query string. This is no different than php. It may not be “SEO friendly”, but all web development languages do this, even MVC. SEO requires URL rewriting, and you can do it with anything. MVC just hides it.

Less control over HTML

It is true that you use controls to handle server side HTML calls with web forms. But, you don’t have to use the controls for everything. You are free to your HTML and JavaScript wherever you don’t need to access information on the server. Yes, you don’t have the IDs of your elements, but you don’t need them with JavaScript. You can use classes instead.

With all these issues, I am starting to see a pattern here. All the complaints against web forms are developer errors and mistakes. I guess most developers prefer to blame their tools than their own lack of skills.

Ticking off an entire group of people aside, I see no reasons to jump on to the ASP.Net MVC bandwagon for either my own website or those I create for clients. There may be a time I will need to use MVC, but ‘tis not this day.

If you feel the same way, add your take to the comments below. You can also use it to state how much of an idiot I am.


(adsbygoogle = window.adsbygoogle || []).push({});
asp-net-web-forms-work-best-for-small-sites

ABOUT THE AUTHOR

1 Comment

  1. Jeff Kershner

    I started doing ASP.NET MVC to support a project written by someone else and I have never looked back. Now I can’t imagine starting a new project in WebForms and exclusively use MVC for everything.

POST YOUR COMMENTS

Your email address will not be published. Required fields are marked *

Name *

Email *

Website

Skip to toolbar