I have code which will fire on load, and fetch the object based on the ID. It returns null.
<script type = "text/javascript">
$(function(){
var TV = $find("FieldTreeViewer");
});
</script>
<body>
<telerik:RadTreeView OnClientNodeExpanded="nodePopulating" OnClientNodeClicked="checkLeaf" runat="server" ID = "FieldTreeViewer">
</telerik:RadTreeView>
</body>
It seems that onload will return null, but if i go into the console and reenter the var TV statement, it will assign it. I figure that the Control was NOT rendered yet. How would I go about making it so that the page renders BEFORE firing the function?
I am aware of asp having onLoad, onInit, etc, but this is purely markup, there is no magic behind the scenes.
I just thought that markup would render, and then when the page finishes loading, i could call a function to reference the control by ID.