How can I display an alert when a user attempts to page through a gridview? I have implemented a script for this purpose, but the alert appears even if any other buttons on the page are clicked. Ideally, I would like the alert to only show when paging is clicked.
<script type="text/javascript">
function closeEditorWarning() {
return 'It seems like you are in the middle of editing something -- if you navigate away, your changes may be lost.'
}
window.onbeforeunload = closeEditorWarning
</script>
Any suggestions on how to achieve this specific behavior will be greatly appreciated.