Add the class to your view folder and name it (for example) Foo and make sure that this class inherits ViewPage or ViewPage in case your View is strongly typed.
Then, in changing the markup, aspx is inherited from the attribute of the @page directive to Foo.cs
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="Foo" CodeBehind="~/Views/Home/Foo.cs" %>
Hope this helps.
source share