In your page directive do the following:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="TestApp._Default" EnableViewState="false" %>
Mainly turning off ViewState
will make up a majority of the difference in page performance. Also limitting the use of WebForm controls will also make your HTML served up a lot less verbose as they tend to produce very verbose HTML.
On the other hand doing so is almost like cutting away some of the large advantages to WebForms. The controls and the abstracting of state by using ViewState
is some of the main reason's why WebForms is so popular today.
I do a lot of WebForms development still and do MVC as well. Having knowledge of both and their strengths will help you create a performant app in either framework. When I create any new WebForms app, the first thing I do is to wrap pages in a Panel
make sure to disable ViewState
for the entire panel. As I develop, and I find a use for the ViewState
(eg. to save me time or simplify things) I turn it on case by case so I understand why I am using it and make a consious decision to add the overhead to my page.
WebForms can be just as fast as MVC if you approach your web app with performance in mind but it's very easy to make it much slower if you want to just ignore performance and just get the app done.