Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > custom server control: problem with designer

Reply
Thread Tools

custom server control: problem with designer

 
 
Jürgen Müller
Guest
Posts: n/a
 
      08-30-2006
Hi, all.

I'm having a strange problem while writing custom server control.
The control works fine so far, but I wanted to add some features which
support the developer while using the control in the Visual Studio designer.
Therefore I've added a designer which extends ContainerControlDesigner...see
code fragment below.

Problem:
Sometimes the cast MyComponent c = (MyComponent)base.Component will throw an
exception - and sometimes not. I haven't found a reason for this. The type of
base.Component is MyComponent. I've checked this in the debugger. Even Visual
Studio shows me all properties of this type during debugging.
I've modified the code and read the value of c.MyProperty via reflection -
and it works...

Any ideas what might be wrong or what happens here?

Any help appreciated.

Reagrds
Jürgen
Code fragment:

public class MyDesigner : ContainerControlDesigner
{

public override string FrameCaption {
get
{
MyComponent c = (MyComponent)base.Component;

return "MyComponent - " + c.MyProperty;
}

}


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Designer Property Serialization -- Sycning inner properties to designer property window Alexander Higgins ASP .Net Building Controls 3 07-30-2007 09:09 PM
Designer Property Serialization -- Sycning inner properties to designer property window Alexander Higgins ASP .Net Web Controls 0 07-21-2007 12:58 AM
Sharepoint Designer/ Expression Web Designer : adding item in toolbox ? Steve B. ASP .Net 4 06-01-2007 04:29 AM
WebControl Designer Problem using Custom Collection Todd Lucas via .NET 247 ASP .Net Building Controls 2 05-28-2004 02:34 PM
Custom Control not displaying text in Designer Earl Teigrob ASP .Net 0 10-30-2003 03:12 PM



Advertisments