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.
and after I have retreived the data base in my controls load method I have the followingCode:function AddText(elementid, txtval) { var txtArea = document.getElementByID ( elementid ); if ( txtArea ) { txtArea.value = txtval; } }
When I run the code the function gets called and appears to pass the correct values in, however it throws this errorCode:if (!Page.ClientScript.IsStartupScriptRegistered("AddText")) { Page.ClientScript.RegisterStartupScript (this.GetType(), "AddText", "AddText('txtArea', '" + aOutline1.Overview + "');", true); }
when it hits the code document.getElementByID ( elementid );Microsoft JScript runtime error: Object doesn't support this property or method
I guess this may have something to do with it being on a user control?
Anyone able to help at all.





Reply With Quote