I'm not a fan of the codebehind and designer files that are generated when you create a new ViewPage. I like a clean solution and for me that means view files (.aspx) that don't have plusses next to them (see the photo to the right and compare the Home and Login folders).
If you want to use strongly typed view data and you don't want to add the codebehind and designer files for the measly few characters you have to type to make a view strongly typed:
1: public partial class Index : ViewPage<LoginData>
2: {
3: }
In this particular case I have to add two extra files to source control solely for the purpose of having "<LoginData>"...seems like a waste.
If you want to do the same thing without the extra overhead of two files, simple use CLR notation
1: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
2: CodeBehind="Index.aspx.cs"
3: Inherits="ABCCompany.MVC.Web.Views.Home.Index" %>
becomes
1: <%@ Page Language="C#"
2: MasterPageFile="~/Views/Shared/Site.Master"
3: Inherits="System.Web.Mvc.ViewPage`1[[ABCCompany.MVC.Web.Models.LoginData, ABCCompany.MVC.Web]]" %>
Not the prettiest code I've ever seen, but it gets the job done without extra (needless) files.
This blog contains the thoughts and discoveries of Tim Barcz, a technologist with a interests in computer programming technologies.