I have to agree with
Sergey Alexandrovich Kryukov. It depends completely on what you are intending to do, i.e the requirements of your project & task. However, just to help you get the picture, here's my point of view:
1. Javascript is mostly used as an excellent eye candy enhancer. You have the flashy controls, pop-ups and what not that make the web site more interactive and mostly give it a kind-of nice continuous flow.
2. Code behind is mostly used to control the page's core logic: Should this page be delivered for this user? Should the user be shown the button to erase all memory and force water to turn red...you get the drift: actions/things that affect the system/application as such.
3. And you also do redundant work, like validating, on both client and server end; or maybe concurrent work, like having an AJAX call to fetch data rather than having the data sent with the page (for pagination etc).
Validating on the client side makes it easier for the user(and the server of course), since illegal characters, min/max length etc won't require server interaction; and consecutively repeated page generations for taping that extra **#&!^%, and validating on the server side is ALSO necessary since, lets face it, Javascript is at the mercy of the client.
Well, I hope that paints a good enough picture!