Last post Mar 27, 2008 12:24 PM by NHaghighi
Jan 27, 2006 01:32 PM|bthorne|LINK
I have an implementation of custom server controls that are designed to reside inside a custom page class that inherits from System.Web.UI.Page, like all code-behind pages. This page implements an interface so that my control can make requests from the
After conversion, the application runs fine--everything works OK, BUT in VS2005, I cannot design my pages anymore, as all my controls are broken...they just have those gray blobs reporting an exception, which I can work-around with enough garbage-code, but...
This worked in ASP1.1, VS2003:
protected override void OnInit(EventArgs e)
MyPageClass myPage=(MyPageClass) Page; // Control.Page property
This now fails in ASP2.0, VS2005, because VS2005 is now not creating a MyPageClass object in the designer, it is creating simply a System.Web.UI.Page, so the above throws the exception "Unable to cast object of type 'System.Web.UI.Page' to type 'MyPageClass'.
Is there any way to get VS2005 to create an instance of MY page class instead of System.Web.UI.Page in design mode? I have tried CodeFileBaseClass in my @Page directive but this has had no effect.
Jan 29, 2006 10:40 PM|ScottGu|LINK
I just forwarded this thread to a dev who works on the VS 2005 designer. He should hopefully be getting back to you shortly on this one.
Jan 30, 2006 01:29 PM|timmcb|LINK
Mar 27, 2008 12:24 PM|NHaghighi|LINK
We're using .NET 3.5
on VS 2008 - has this issue been fixed yet?