I am creating controls which are added to the page at run time. As these controls are added I separate them into a UL/LI list by injecting literals assigned as (,,). The page in question uses a master page template. The ul/li function is called in the page_load event of the child page.
I want to assign a script that collapses this list. How do I apply the script so that it will fire after all the dynamic controls have been created and added.
I've tried
<body onload = > sPage.ClientScript.RegisterStartupScript(Me.GetType, "MyFunction", "setvisibility();", True)
The bad thing with onload is that it's called before everything is actually drawed in the page, jQuery have fixed this issue. Write this up in the header script.
<script type="text/javascript">
$(document).ready(function() {
sPage.ClientScript.RegisterStartupScript(Me.GetType, "MyFunction", "setvisibility();", True)
});
</script>