Don't use Page.Controls.Add() method. Depending on the work you shoudl
accomplich I would do it the simplest way possible and implement a compound
server control using CreateChildControls method and create your hidden
field.
You better check MSDN for that and get back for further assistance and we
will tell you which methods you really need to override.
And BTW. If your custom control won't rander anything visible (if it has
only Hidden field), that better inherit from Control class instead of
WebControl, because you don't need properties like Width, Height, Back...
blah blah blah...
--
RobertK
{ Clever? No just smart. }
"Galore" <> wrote in message
news:...
> Hello,
>
> I'm writing a custom webcontrol, and I need to make it add input hidden
> controls within the tag form. Using Page.Controls.Add(control) isn't
> working, it's putting the control outside the tag form, then I can't
> access its data when I postback the webpage.
>
> Does anyone here can give me a clue about this?
>
> Thanks
|