Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / November 2007

Tip: Looking for answers? Try searching our database.

WebControl with VS2008

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ikari - 26 Oct 2007 18:43 GMT
Hello,

I have a webcontrol that works perfectly in VS2005, but breaks during
design-time in VS2008. The error message is:
Unable to cast object of type Microsoft.Web.Design.DocumentDesigner to
System.Web.UI.Design.WebFormsRootDesigner.

The control's design time inherits
System.Web.UI.Design.ControlDesigner.

Does anyone have any idea what's going on here, or what was changed in
Orcas in relation to design time for controls?

Thanks.
Teemu Keiski - 28 Oct 2007 08:45 GMT
Hi,

type name "Microsoft.Web.Design.DocumentDesigner " refers that this is
something probably being worked out while beta 2 was released. These usually
end up in System namespace when they're in release condition so I'd bet it
is in shape in RTM. However, I have contacted my peers to ensure the case.

Signature

Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

> Hello,
>
[quoted text clipped - 10 lines]
>
> Thanks.
Teemu Keiski - 01 Nov 2007 17:51 GMT
This  is what I got

Neither in Beta2, nor now, could you have cast a DocumentDesigner to
WebFormsRootDesigner.

My first guess would be that the user's control gets an object that
implements some interface (maybe IWebFormsDocumentService,
IResourceUrlGenerator, or IContentResolutionService), where in Whidbey it
was the WebFormsRootDesigner that implemented that interface. That would
make the cast possible but not advised. Those interfaces are now implemented
by the DocumentDesigner, so the cast wouldn't work in VS2008.

If the user is trying to get the WebFormsRootDesigner, the correct way to do
it would be to get the IDesignerHost, and then do this:

IDesignerHost designerHost =
Component.Site.GetService(typeof(IDesignerHost)) as IDesignerHost;

WebFormsRootDesigner rootDesigner =
designerHost.GetDesigner(designer.RootComponent) as WebFormsRootDesigner;

Signature

Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

> Hi,
>
[quoted text clipped - 18 lines]
>>
>> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.