Executing code when an ASP.NET Atlas page first loads
Someone asked me how they could execute code when an Atlas page first loaded. In the 'Atlas' xml-script declarative section, add a load attribute to the <application element. The load attribute points to your javascript function. Its that simple.
<%@ Page Language="C#" %>
<html>
<head>
</head>
<body>
<form ID="Form1" runat="server">
<atlas:ScriptManager id="Script" runat="server">
</atlas:ScriptManager>
</form>
<script type="text/javascript">
function onLoad(){
alert("Hello, run your code here!");
}
</script>
<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<application load="onLoad">
</application>
</components>
</page>
</script>
</body>
</html>