Oct 22, 2008 12:20 AM|levib|LINK
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:
In my application, this produces a mangled name of System.Web.Mvc.ViewPage`1[[System.Collections.Generic.IList`1[[MvcApplication5.Models.Class1, MvcApplication5, Version=184.108.40.206, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=220.127.116.11, Culture=neutral,
PublicKeyToken=b77a5c561934e089]]. So the @ Page directive would look like:
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.