Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,
I have a form which is having updatepanel . i created a javascript file to validate
form controls when i submit my form first time javascript work fine but after postback .
external javascript file functions are not working . whereas without updatepanel it is working fine.

rgds
Posted

1 solution

i got the solution reference your javascript file within scriptmanager
add following mandatory lines to execute jquery functions after updatepanel
asynchronous postback



mandatory lines are
C#
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);


bind endrequest function after updatepanel asynchrous postback
function EndRequest() {
init();
}



add functions on document initialization

function init() {
$('#btn1').click(function () {
alert($('#txt').val());
});
}


$(document).ready(init);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900