asp.net - All controls are still null after calling EnsureChildControls()? -


the way page laid out, of data loaded @ page_init. well, have custom control having problems though.

i have on page so:

<cc:somecontrol... /> 

and set value @ page_init using

mycontrol.value="blah"; 

simple stuff..

the value accessor , has similar this:

public string value{   get...   set{     ensurechildcontrols();     myhiddenfield.value=value;   } } 

and here have problem. says myhiddenfield null. page_init this? or there other function need call?

the fix changing using namespace reference customcontrol using src filename

changing this:

<%@ register assembly="myproduct" namespace="myproduct.customcontrols" tagprefix="cc" %> 

to this:

<%@ register src="/customcontrols/mycontrol.ascx" tagname="mycontrol" tagprefix="uc2" %> 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -