Niloo Niloo - 1 year ago 92
ASP.NET (C#) Question

Execute javascript after a partial postback of an updatepanel?

I have a page that add tree file script to it .

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/init.js"></script>
<script type="text/javascript" src="js/easing.js"></script>

I have a updatepanel with a dropdownlist. When run SelectedIndexChanged event (partial postback of an updatepanel), don't execute javascript .

Answer Source


function pageLoad(sender, args) {


function InitialiseSettings(){
    // replace your DOM Loaded settings here. 
    // If you already have document.ready event, 
    // just take the function part and replace here. 
    // Not with document.ready 
    $(element).slideUp(1000, method, callback});

                   duration: 1000, 
                   easing: method, 
                   complete: callback});

or try with add_endRequest event handler:



Better move the all the code from document.ready to InitialiseSettings function and pass it to pageLoaded event


Code Example:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download