Edit this page

Change Mouse Cursor on AJAX Update

Changing the mouse cursor on Ajax update could be achieved using the client-side event of Telerik RadAjax controls. The easiest way is to use the following events script:

<script type="text/javascript">
            function OnRequestStart(sender, args) {
                document.body.style.cursor = "wait";
            }
            function OnResponseEnd(sender, args) {
                document.body.style.cursor = "default";
            }
</script>

Here is another solution using additional CSS classes:

<script type="text/javascript">
            function RequestStart(sender, args) {
                document.body.className = document.body.className.replace("Normal", "Wait");
            }
            function ResponseEnd(sender, args) {
                document.body.className = document.body.className.replace("Wait", "Normal");
</script>
<style type="text/css">
            .Wait
            {
            }
            .Normal
            {
            }
            /* override input cursors with a more specific CSS selector */.Wait INPUT
            {
                cursor: wait;
            }
            .Normal INPUT
            {
                cursor: default;
            }
            /* override grid cursors with a more specific CSS selector */.Wait TABLE
            {
                cursor: wait;
            }
            .Normal TABLE
            {
                cursor: default;
            }
</style>