Hello,

I have a .net user control which gets some data from the database in the controls load event, once it has this data I want it to populate a html text area on the same control.

I have looked at many examples of how to populate client controls from server side code but not ones on a user control.

So far I have the following in script blocks at the start of my markup.
Code:
 function AddText(elementid, txtval) {     var txtArea = document.getElementByID ( elementid );     if ( txtArea )     {       txtArea.value = txtval;     }  }
and after I have retreived the data base in my controls load method I have the following

Code:
if (!Page.ClientScript.IsStartupScriptRegistered("AddText"))
                {
                    Page.ClientScript.RegisterStartupScript
                        (this.GetType(), "AddText", "AddText('txtArea', '" + aOutline1.Overview + "');", true);
                }
When I run the code the function gets called and appears to pass the correct values in, however it throws this error
Microsoft JScript runtime error: Object doesn't support this property or method
when it hits the code document.getElementByID ( elementid );

I guess this may have something to do with it being on a user control?

Anyone able to help at all.