To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
"John Saunders" <john.saunders@surfcontrol.com> wrote in message
news:%23sWP3ZoWDHA.652@tk2msftngp13.phx.gbl...
> Victor, you've got it.
>
> The designer for that control had been derived from my
> CompositeControlDesigner. But then I added template functionality and
> changed it to derive from my BaseTemplatedDesigner, which did not contain
> the Get*DesignTimeHtml methods. In the absence of multiple inheritance, I
> had to copy everything interesting from CompositeControlDesigner into the
> derived designer. And I missed GetErrorDesignTimeHtml!
>
> Thanks!
> John Saunders
> Internet Engineer
> john.saunders@surfcontrol.com
>
> P.S. You should send your response to Microsoft Framework Documentation.
You
> could save them (and posterity) a lot of work.
>
> "Victor Garcia Aprea [MVP]" <vga@NOobiesSPAM.com> wrote in message
> news:uVnrIsjWDHA.1900@TK2MSFTNGP10.phx.gbl...
> > Hi John,
> >
> > >>>ControlDesigner.GetDesignTimeHtml of course, calls
> > >>>((Control) component).Render(htmlStringWriter) and then returns the
> > string.
> >
> > Actually it does a bit more:
> >
> > a) it will call RenderControl (note, not Render), then, if any
exceptions
> > were thrown it will call GetErrorDesignTimeHtml (which by default
returns
> an
> > empty string).
> > b) if it still has an empty string as the html it will call
> > GetEmptyDesignTimeHtml.
> >
> > Per your description it seems like:
> >
> > 1) your control is throwing an exception in Render thus causing the
> control
> > designer to call GetErrorDesignTimeHtml
> > 2) you're not overriding GetErrorDesignTimeHtml, so the default
> > implementation will return an empty string
> > 3) as the control designer can't still get a non-emtpy string, after
> having
> > tried your control's RenderControl method and calling
> > GetErrorDesignTimeHtml, it will finally call GetEmptyDesignTimeHtml.
> >
> > Please try overriding GetErrorDesignTimeHtml and let me know if that
> helps,
> >
> >
> > --
> > Victor Garcia Aprea
> > Microsoft MVP | ASP.NET
> > Looking for insights on ASP.NET? Read my blog:
> >
http://obies.com/vga/blog.aspx > > To contact me remove 'NOSPAM'. Please post all questions to the
newsgroup
> > and not by private mail.
> >
> > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
> > news:%23Iv9d77VDHA.1748@TK2MSFTNGP12.phx.gbl...
> > > I can create a reproducer for this later, if needed, but I'm too
> > aggravated
> > > at the moment.
> > >
> > > I have a control whose GetDesignTimeHtml method pretty much just calls
> > > base.GetDesignTimeHtml(). ControlDesigner.GetDesignTimeHtml of course,
> > calls
> > > ((Control) component).Render(htmlStringWriter) and then returns the
> > string.
> > >
> > > Recently, the Render method of this control gained some code which
> throws
> > an
> > > exception. Apparently, ControlDesigner.GetDesignTimeHtml catches this
> > > exception - and takes it as an excuse to call
> > this.GetEmptyDesignTimeHtml().
> > >
> > > I've got a try-catch block around my call to base.GetDesignTimeHtml,
so
> if
> > > ControlDesigner.GetDesignTimeHtml had even failed to handle the
> exception,
> > > I'd have picked it up and displayed something useful. Instead, I got a
> > > useless placeholder saying "Please set some parameters". It continues
> > saying
> > > "Please set some parameters" even after I set the parameters, which is
> > quite
> > > frustrating.
> > >
> > >
> > > Could this be fixed, if it's a bug, or documented, if it's a feature,
or
> > > explained, if I missed something?
> > >
> > > Thanks,
> > > John Saunders
> > > Internet Engineer
> > > john.saunders@surfcontrol.com
> > >
> > >
> >
> >
>
>