S
Scott Mitchell [MVP]
(FYI, this question is cross-posted over the ASP.NET Forums -
http://asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=759339)
I have created a custom control that, previously, had a great design
time experience. I don't know what happened, but after Thanksgiving I
returned to this project and now when I try to drag and drop the custom
control from the Toolbox onto an ASP.NET page, nothing appears. No
@Register directive is added, no markup is added to the .aspx page, nothing.
The custom control has a Designer class, so I set some breakpoints in
that page, and debugged on this project. What I found was that when
dragging and dropping the control onto a page, the Designer's overridden
Initialize() method ran, but the GetDesignTimeHtml() override does not
get called at all. However, if I take a page that already has this
control added, both Initialize() and GetDesignTimeHtml() are called, and
the control is displayed properly in the Design tab.
Furthermore, if I manually add the @Register directive and the custom
control's declarative syntax in the HTML tab and switch back to the
Design tab, everything works as it's supposed to. The problem, it seems,
is in dragging and dropping the control, something that worked
previously. No changes had been made to the Designer code or custom
control code. I even tried manually removing the controls from the
Toolbox, restarting VS.NET, and readding them, but still no dice.
Has anyone else encountered a similar problem and, if so, what did you
do to alleve it?
Thanks.
--
Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
* When you think ASP.NET, think 4GuysFromRolla.com!
http://asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=759339)
I have created a custom control that, previously, had a great design
time experience. I don't know what happened, but after Thanksgiving I
returned to this project and now when I try to drag and drop the custom
control from the Toolbox onto an ASP.NET page, nothing appears. No
@Register directive is added, no markup is added to the .aspx page, nothing.
The custom control has a Designer class, so I set some breakpoints in
that page, and debugged on this project. What I found was that when
dragging and dropping the control onto a page, the Designer's overridden
Initialize() method ran, but the GetDesignTimeHtml() override does not
get called at all. However, if I take a page that already has this
control added, both Initialize() and GetDesignTimeHtml() are called, and
the control is displayed properly in the Design tab.
Furthermore, if I manually add the @Register directive and the custom
control's declarative syntax in the HTML tab and switch back to the
Design tab, everything works as it's supposed to. The problem, it seems,
is in dragging and dropping the control, something that worked
previously. No changes had been made to the Designer code or custom
control code. I even tried manually removing the controls from the
Toolbox, restarting VS.NET, and readding them, but still no dice.
Has anyone else encountered a similar problem and, if so, what did you
do to alleve it?
Thanks.
--
Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
* When you think ASP.NET, think 4GuysFromRolla.com!