Hi Sarathlal
You can use Pageload() under Sitemanager > Development > Page Templates > your page template > Layout tab like below
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
<!-- YOUR CODE-->
}
</script>
Best Regards!
Ashish Narnoli