koistya:Looks like removing code-behind file and decalring inheriting class on .aspx/.ascx page itself doesn't bring any value. Because intellisense doesn't work in this scenario.
I'm not sure what is meant by that statement. Intellisense works just fine as long as the Inherits attribute is set correctly. The easiest way I've found to do this is to use a typeof() to get a Type corresponding to the ViewPage<> you want, then to look at its Name property. Copy + paste this string into your .aspx file. For example:
Type viewPageType = typeof(ViewPage<IList<Class1>>);
string mangledName = viewPageType.FullName;
In my application, this produces a mangled name of System.Web.Mvc.ViewPage`1[[System.Collections.Generic.IList`1[[MvcApplication5.Models.Class1, MvcApplication5, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]. So the @ Page directive would look like:
<%
@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage`1[[System.Collections.Generic.IList`1[[MvcApplication5.Models.Class1, MvcApplication5, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]" %>
This horrendous-looking name is how the CLR identifies types. It is independent of any language used (VB, C#, C++, dynamic languages, etc.). Since the directives are not language-specific (note that the Language attribute is just a string attribute, but it doesn't change how the directives are parsed), a language-neutral type representation had to be chosen. This is the CLR's language-neutral representation of generics.