@Vasanth,
JavaScript function will execute after page load completion i.e. when page is rendered in browser.
Thus even if it is getting called you will not be able to do any processing.
Understand my point JavaScript is client side library i.e. runs inside browser while ASP.Net runs on server.
I would recommend you to study the Page Life cycle properly