Article G0004 General
JavaScript Snippets

During my projects last year I've collected some JavaScript-snippets which I almost always use while creating ASP.NET-websites. This page contains a summery of the snippets so that you can use them as well.

StatusStrip | StatusBar Tekst
The statusstrip or statusbar, depending on how you would like to call the area, will simple say 'Done' when a page is loaded:
StatusStrip without JavaScripts

It might be handy to put the functional name of the page within this area. This can be done by adding the following code between the <head> and </head> tags area:

<script type="text/javascript">
    window.status = 'StatusStrip Message'
</script>
This will provide the web-application user a navigation hint. The previous example will be shown like this:

StatusStrip with JavaScript
Previous Page
Place a button within the designer and call it 'btnBack'. Within the Page_Load()-method of the page add the following code:

btnBack.OnClientClick =
    "javascript:window.history.go(-1);return false;"
Pressing the button will redirect the page to the previous one. If this was the first page, nothing will happen.

~Edward