Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Control Removing contents when editing properties

Reply
Thread Tools

Control Removing contents when editing properties

 
 
MattC
Guest
Posts: n/a
 
      07-14-2004
I have a custom control, that I add via the HTML view of my aspx page. I
then also manually added a datagrid as a child control.

<mycontrol:tagname runat=server id=foo>
<asp:datagrid runat=server id=foobar></asp:datagrid>
</mycontrol:tagname>

When I switch to design mode and edit the control foo's properties and then
switch back to html view the datagrid is gone.

Also the dataggrid does not show up in design view.

Here is my controls render section:

protected override void RenderChildren(HtmlTextWriter writer)
{
WritePanelTop(writer); //writes out table beginning
base.RenderChildren(writer); //should write out the datagrid via its
render method
WritePanelBottom(writer); //writes out tables end
}

Help?!?!

MattC


 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      07-15-2004
"MattC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a custom control, that I add via the HTML view of my aspx page. I
> then also manually added a datagrid as a child control.
>
> <mycontrol:tagname runat=server id=foo>
> <asp:datagrid runat=server id=foobar></asp:datagrid>
> </mycontrol:tagname>
>
> When I switch to design mode and edit the control foo's properties and

then
> switch back to html view the datagrid is gone.
>
> Also the dataggrid does not show up in design view.
>
> Here is my controls render section:
>
> protected override void RenderChildren(HtmlTextWriter writer)
> {
> WritePanelTop(writer); //writes out table beginning
> base.RenderChildren(writer); //should write out the datagrid via its
> render method
> WritePanelBottom(writer); //writes out tables end
> }


Matt, how do you have ParseChildren set for your control? Also, have you
considered deriving from the Panel control, which already knows how to
contain child controls?
--
John Saunders
johnwsaundersiii at hotmail


 
Reply With Quote
 
 
 
 
MattC
Guest
Posts: n/a
 
      07-16-2004
John,

I have ParseChildren(false) and I am deriving from Panel.

I also havea problem with the controls inside not maintaining their state.

protected override void Render(HtmlTextWriter writer)
{
WritePanelTop(writer);

if(!Page.IsPostBack && (_defaultHide == true) || (Page.IsPostBack &&
_hide == true))
{
SwitchImage();

foreach(Control c in this.Controls)
{
c.Visible = false;
}

}

base.RenderChildren(writer);

WritePanelBottom(writer);

}

MattC


"John Saunders" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> "MattC" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I have a custom control, that I add via the HTML view of my aspx page.

I
> > then also manually added a datagrid as a child control.
> >
> > <mycontrol:tagname runat=server id=foo>
> > <asp:datagrid runat=server id=foobar></asp:datagrid>
> > </mycontrol:tagname>
> >
> > When I switch to design mode and edit the control foo's properties and

> then
> > switch back to html view the datagrid is gone.
> >
> > Also the dataggrid does not show up in design view.
> >
> > Here is my controls render section:
> >
> > protected override void RenderChildren(HtmlTextWriter writer)
> > {
> > WritePanelTop(writer); //writes out table beginning
> > base.RenderChildren(writer); //should write out the datagrid via its
> > render method
> > WritePanelBottom(writer); //writes out tables end
> > }

>
> Matt, how do you have ParseChildren set for your control? Also, have you
> considered deriving from the Panel control, which already knows how to
> contain child controls?
> --
> John Saunders
> johnwsaundersiii at hotmail
>
>



 
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
Login control missing some properties in the properties pane Adam M ASP .Net 1 01-23-2008 10:06 PM
Designer Support: How to have user control's properties appear in IDE's properties window? Max2006 ASP .Net 2 07-13-2007 01:45 PM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net 0 10-17-2005 02:05 AM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net Building Controls 0 10-17-2005 02:05 AM
Viewing or Editing Web User Control properties in the designer Jay Douglas ASP .Net 2 11-02-2003 01:27 AM



Advertisments