protected void Page_Load(object sender, EventArgs e)
{

//在UpdatePanel中回传事件不重新加载页面.会导至页面的jQuery事件失效.
RegisterStartupScript("", "<script type=\"text/javascript\">ReloadjQuery();</script>");
if (!IsPostBack)
{
      // to do smth...
}
}
s
<script language="javascript" type="text/javascript">
$(document).ready(
function() {
$(
'#btnSubmit').click(function() {
//to do smth..
});


EndRequestHandler();

});

function ReloadjQuery() {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}

function EndRequestHandler() {
$(document).ready(
function() {
// to do smth.. JS Code..
});
}
</script>
posted on 2011-06-02 10:32  pchgo  阅读(370)  评论(0编辑  收藏  举报