ASP.NET is a server-based platform, which means the code you write executes on the web server instead of in the client's browser. This approach ensures that your code is kept secure from prying eyes, and it sidesteps most browser-compatibility issues. However, it also introduces some unavoidable limitations.


For example, the ASP.NET web page model doesn't provide any way to react to events, such as a user's mouse movements. In this case, the overhead of sending the page back to the server after every mouse movement would make the web page unworkably slow. Similarly, because your code can't interact directly with the browser, it can't display pop-up windows or manage multiple frames in a frameset in the same way a snippet of client-side JavaScript could.


To compensate for these limitations, ASP.NET developers often need to mix a little JavaScript code into their ASP.NET web pages. This is most commonly the case with custom controls. For example, many menu controls allow the user to browse through multiple menu levels without forcing the page to be posted back to the server every time a new level is shown. (You can find sample menu controls at Microsoft's community site.) Similar techniques are used to ensure that other controls remain rich and responsive, without requiring any work from the web server.


Read more here.