javascript - jQuery selectors not working after ASP.NET postback (no UpdatePanels, not AJAX) -


i need make change old page possible, , effort ajax-ify in order obviate postbacks take long (making more correct version of have come later, new functionality needs in place asap). javscript changes required complicated attempt entirely in plain js page uses (it's enough of mess is), decided implement new functionality using jquery.

everything works fine until there's postback, after document ready function still runs, selectors no longer find anything. i'm not using asp.net ajax, there's no updatepanels or partial postbacks.

what's happening , how can fix in simplest, fastest possible way?

while $(document).ready() ideal one-time initialization routines, leaves hanging if have code needs re-run after every partial postback. of course there ways around this. can try using .net franeworks pageload() , bind events there , see if selectors still work after postback.

<script type="text/javascript">   function pageload() {     $("#button1").on('click', function () {        ...     });   } </script> 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -