I need to populate treeview using javascript.......
Seeing as the TreeView is a .NET control, it would be very difficult to populate it using JavaScript. Your .NET code exists on the server...that means it is used on the server only. Your JavaScript code is run in on the client's side....in the browser.
Mr Gray has rightly suggested that you use Ajax to solve your problem. Ajax allows you to make Server Side calls once the page is loaded.
I would be questioning why you need to do this?
Why can't you just load the TreeView in your server side code and let it run as is once the page is rendered in the browser?
-Frinny