ASP.Net : Need to run javascript on update panel load completed

前端 未结 4 1495
攒了一身酷
攒了一身酷 2021-01-11 18:43

I need to run a javascript function when the update panel is loaded completely(I want to scroll), and not on initial page load.

Please suggest.

Thanks

4条回答
  •  执念已碎
    2021-01-11 19:29

    you can use below code with if jquery is used

    This is to show saved message and hide that message after 5 seconds after update panel is updated

    function pageLoad() {
                window.Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
            }
            function EndRequestHandler()
            {
                window.setTimeout(function () {
                    var label = window.$get('<%= lblMsg.ClientID%>');
                    if (label != null) { label.style.display = 'none'; }
                }, 5000);
            }
    

提交回复
热议问题