This is a migrated thread and some comments may be shown as answers.

Leave page prompt on postback

1 Answer 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 22 Aug 2013, 03:19 PM
I have noticed that every time that a post-back is triggered with RadControls, I receive an 'Are  you sure you want to leave this page?' prompt in Firefox.  So far I have tested it with the RadListBox and the RadTabStrip/RadMultiPage controls. 

Is there a way to stop this prompt from displaying every time I click a control?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Aug 2013, 02:15 PM
Hi Charles,

Please try the following JavaScript.

JavaScript:
<script type="text/javascript">
    window.onbeforeunload = function () {
        saveFormData();
        return null;
    }
    function saveFormData() {
        console.log('saved');
    }
</script>

Thanks,
Shinu.
Tags
General Discussions
Asked by
Charles
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or