Skip to content

Instantly share code, notes, and snippets.

@KyleShen
Last active June 13, 2016 06:46
asp.net_postback_javascript
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" language="javascript">
//postback,jquery事件會失效
//重新註冊按鈕事件
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
initailEvent();
}
$(function(){
initailEvent();
});
//重新註冊事件
function initailEvent(){
$('#btnSend').click(function(){
alert('OK');
});
}
</script>
<input id='btnSend' type='button' value='Send' />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment