[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Heath Stewart

1/17/2003 6:24:00 PM

I'm not sure this is the right place to ask about this, but no other
newsgroup seemed appropriate (since there's a windowsforms.design but not an
aspnet.design newsgroup).

I'm making a WebControl that is a container and renders a <fieldset> (with
optional <legend>) tag. I attributed the class with ParseChildren(false),
PersistChildren(true) and added a designer that extends
ReadWriteControlDesigner. In the designer, the control does accept text and
other controls and it does render correctly in the page when viewed with a
browser. Everything seems fine.

However, I noticed that the designer doesn't render my control properly in
on the design surface, despite the fact that HtmlTextWriterTag.Fieldset is
present (and, hence, implies support for it?). I overroad both TagKey and
TagName to essentially return <fieldset>. First,
ControlDesigner.GetDesignTimeHtml() does not render the tag right and if I
override it, my method doesn't get called at all! I've traced the IL (via
ildasm.exe) all the way from my designer to ControlDesigner and there is no
way (especially since that method is virtual) that mine shouldn't get
called. I even tried overriding OnComponentChanged() and doing something
that would be obvious (like MessageBox.Show()).

To test everything else, I added DesignerVerbs, filtered properties, etc.,
and everything else works fine. So, why are my virtual methods not getting
called and why doesn't ControlDesigner render my control properly in the
first place? All my WebControl does is override two tag-related properties
and RenderContents so that the <legend> tag can be added immediately after
the begin tag. That's it.

TIA

--

Heath Stewart
Software Engineer / Network Administrator
Proplanner.NET: Web-based Production Planning Solutions
http://www.prop...


2 Answers

(Patrick C. Cole (MS))

1/20/2003 6:00:00 PM

0

Heath,

You may want to consider contacting Microsoft Product Support Services
directly for this issue. You may be able to get a much faster response
than via the newsgroups.

But I will be glad to look into this more if you can post a repro for this.
A sample will certainly help get us started on what is going on with your
control.

Thanks!

Patrick Cole
Microsoft Developer Communities

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
--------------------
| From: "Heath Stewart" <nospam.clubstew@hotmail.com>
| Subject: ControlDesigner not working
| Date: Fri, 17 Jan 2003 11:24:36 -0600
| Lines: 39
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <ucSXF1kvCHA.2576@TK2MSFTNGP10>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: 134.244.175.100
| Path: cpmsftngxa09!TK2MSFTNGP08!TK2MSFTNGP10
| Xref: cpmsftngxa09
microsoft.public.dotnet.framework.aspnet.webcontrols:8585
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I'm not sure this is the right place to ask about this, but no other
| newsgroup seemed appropriate (since there's a windowsforms.design but not
an
| aspnet.design newsgroup).
|
| I'm making a WebControl that is a container and renders a <fieldset> (with
| optional <legend>) tag. I attributed the class with ParseChildren(false),
| PersistChildren(true) and added a designer that extends
| ReadWriteControlDesigner. In the designer, the control does accept text
and
| other controls and it does render correctly in the page when viewed with a
| browser. Everything seems fine.
|
| However, I noticed that the designer doesn't render my control properly in
| on the design surface, despite the fact that HtmlTextWriterTag.Fieldset is
| present (and, hence, implies support for it?). I overroad both TagKey and
| TagName to essentially return <fieldset>. First,
| ControlDesigner.GetDesignTimeHtml() does not render the tag right and if I
| override it, my method doesn't get called at all! I've traced the IL (via
| ildasm.exe) all the way from my designer to ControlDesigner and there is
no
| way (especially since that method is virtual) that mine shouldn't get
| called. I even tried overriding OnComponentChanged() and doing something
| that would be obvious (like MessageBox.Show()).
|
| To test everything else, I added DesignerVerbs, filtered properties, etc.,
| and everything else works fine. So, why are my virtual methods not getting
| called and why doesn't ControlDesigner render my control properly in the
| first place? All my WebControl does is override two tag-related properties
| and RenderContents so that the <legend> tag can be added immediately after
| the begin tag. That's it.
|
| TIA
|
| --
|
| Heath Stewart
| Software Engineer / Network Administrator
| Proplanner.NET: Web-based Production Planning Solutions
| http://www.prop...
|
|
|

Jesse Ezell

1/21/2003 12:35:00 AM

0

This is a known "issue" with the
ReadWriteControlDesigner, although I don't know if anyone
has marked it as an actual bug. The Microsoft product
team that is working on this seems to have a different
oppinion of what exactly it should be doing than the rest
of the world ;-). GetDesignTimeHtml will never work with
the designer, because it sets an internal property to
true, which disables the call (I too spent much time in
the IL to track this down). If you want to make a custom
designer, inherit from a different designer (not
PanelDesigner either, since it inherits from
ReadWriteControlDesigner).

If you need panel like support, it is theoretically
possible to mimick the behavior of the designer by
placing contenteditable attributes in the right places. I
made really good toward this a while back (had everything
working pretty good with the exception of a minor few
bugs), but it wasn't worth all the effort and Microsoft
couldn't provide any help or documentation, so I
abandoned my efforts. If you push hard enough you might
be able to get them someone at MS to give you some
insight here...although you would probably have to talk
directly with someone from the ASP.NET team on that one
(if you find out anything useful, let me know).
Unfortunately, since it is technically the desired
behaviour of the designer to skip that call, it looks
like you are on your own on this one.

--Jesse


>-----Original Message-----
>I'm not sure this is the right place to ask about this,
but no other
>newsgroup seemed appropriate (since there's a
windowsforms.design but not an
>aspnet.design newsgroup).
>
>I'm making a WebControl that is a container and renders
a <fieldset> (with
>optional <legend>) tag. I attributed the class with
ParseChildren(false),
>PersistChildren(true) and added a designer that extends
>ReadWriteControlDesigner. In the designer, the control
does accept text and
>other controls and it does render correctly in the page
when viewed with a
>browser. Everything seems fine.
>
>However, I noticed that the designer doesn't render my
control properly in
>on the design surface, despite the fact that
HtmlTextWriterTag.Fieldset is
>present (and, hence, implies support for it?). I
overroad both TagKey and
>TagName to essentially return <fieldset>. First,
>ControlDesigner.GetDesignTimeHtml() does not render the
tag right and if I
>override it, my method doesn't get called at all! I've
traced the IL (via
>ildasm.exe) all the way from my designer to
ControlDesigner and there is no
>way (especially since that method is virtual) that mine
shouldn't get
>called. I even tried overriding OnComponentChanged() and
doing something
>that would be obvious (like MessageBox.Show()).
>
>To test everything else, I added DesignerVerbs, filtered
properties, etc.,
>and everything else works fine. So, why are my virtual
methods not getting
>called and why doesn't ControlDesigner render my control
properly in the
>first place? All my WebControl does is override two tag-
related properties
>and RenderContents so that the <legend> tag can be added
immediately after
>the begin tag. That's it.
>
>TIA
>
>--
>
>Heath Stewart
>Software Engineer / Network Administrator
>Proplanner.NET: Web-based Production Planning Solutions
>http://www.prop...
>
>
>.
>