After creating a custom web user control in a ascx file I can dynamically add an instance of this control to the web forms Controls collection at runtime, but it won't render. Anybody know why?

Re: Dynamic UserControls not rendering by kwarnke

kwarnke
Tue May 11 22:47:22 CDT 2004

FYI - this is a Windows Forms Newsgroup... however:

How are you creating the instance of this control?

Are you using Control c = Page.LoadControl("my.ascx")?

- Kevin

"nova_jsh01" <anonymous@discussions.microsoft.com> wrote in message
news:80AA0FF6-2372-4293-8A22-188AA2D2F66D@microsoft.com...
> After creating a custom web user control in a ascx file I can dynamically
add an instance of this control to the web forms Controls collection at
runtime, but it won't render. Anybody know why?



Re: Dynamic UserControls not rendering by anonymous

anonymous
Wed May 12 05:46:05 CDT 2004

Thanks for the response Kevin and for your suggestion. I'm not using LoadControl because my User control is actually a class, part of my project, not in a seperate file. The syntax I'm using i

Dim c As WebUserControl
Controls.Add(New WedUserControl1
c = FindControl(Controls.Item(Controls.Count - 1)).ClientID

thx

Re: Dynamic UserControls not rendering by kwarnke

kwarnke
Wed May 12 16:09:27 CDT 2004

But is it a "UserControl" as part of an ASCX file (as you mentioned in your
original post)? Or, is it a "Server Control"?

What base class is your class inheriting from? Can you post it's contents
for further review?

- Kevin


"nova_jsh01" <anonymous@discussions.microsoft.com> wrote in message
news:EB405B40-EE05-4CD1-B33F-4F7066468279@microsoft.com...
> Thanks for the response Kevin and for your suggestion. I'm not using
LoadControl because my User control is actually a class, part of my project,
not in a seperate file. The syntax I'm using is
>
> Dim c As WebUserControl1
> Controls.Add(New WedUserControl1)
> c = FindControl(Controls.Item(Controls.Count - 1)).ClientID)
>
> thx



Re: Dynamic UserControls not rendering by nova_jsh01

nova_jsh01
Wed May 19 07:30:33 CDT 2004

It is a UserControl and I'm using this syntax in my declaration:
Public Class UserControlEditEnt : Inherits UserControl

If I get a chance to recode I was going to try using the control.render
method, have u ever had to use that call?

thx

"kwarnke" <nospam@nowhere.com> wrote in message
news:%23idMkVGOEHA.204@TK2MSFTNGP10.phx.gbl...
> But is it a "UserControl" as part of an ASCX file (as you mentioned in
your
> original post)? Or, is it a "Server Control"?
>
> What base class is your class inheriting from? Can you post it's contents
> for further review?
>
> - Kevin
>
>
> "nova_jsh01" <anonymous@discussions.microsoft.com> wrote in message
> news:EB405B40-EE05-4CD1-B33F-4F7066468279@microsoft.com...
> > Thanks for the response Kevin and for your suggestion. I'm not using
> LoadControl because my User control is actually a class, part of my
project,
> not in a seperate file. The syntax I'm using is
> >
> > Dim c As WebUserControl1
> > Controls.Add(New WedUserControl1)
> > c = FindControl(Controls.Item(Controls.Count - 1)).ClientID)
> >
> > thx
>
>