Can you post the code you are using as a get/set accessor? Something a lot
of people make a mistake about is putting code into the page_load event of a
child control because they're used to doing it in the page. The page_load
takes place before that of the page's page_load event. That means that if
you set the property in the page it won't be accessible in the child
control, you need to use a later event, such as overriding the on-prerender
event.
Also, keep in mind that unless you're storing the property values into the
viewstate or another state management mechanism they values won't persist
unless they're specifically set. For example, to set a boolean property of a
child control into the viewstate you can use
public bool MyProperty
{
get {
if(ViewState["MyProperty"] != null)
return (bool)ViewState["MyProperty"];
else
return false;
}
set{ ViewState["MyProperty"] = value;}
}
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Chris" <no****@nospam.comwrote in message
news:ea**************@TK2MSFTNGP04.phx.gbl...
>I have created a date picker user control. I want to have a boolean
property, which I can set to determine whether the control defaults to
today's date. I have created a property which I set to true but when I
create the child controls it has always reset to false. I know it has been
set to true as I have trace written the value in the property "setter". Is
the create child controls event the wrong place to set the textbox, with
the date. Also have trace written the value in the create child controls
and it appears twice. Does this event fire twice? Regards, Chris.