Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
I am trying to call serverside function on textchange and onblur event of dyanamically generated text box.how can i call serverside function on this event.provide solution.
thanx.hv a greate day.
Posted

1 solution

you need use ajax for that. You can use jquery library for ajax communication. example like

JavaScript
function getData(){
$.ajax({
  type: "POST",
  url: "test.aspx",//you can use any web method as well
  data: { name: "John", location: "Boston" }//parameters if you want to send any
}).done(function( msg ) {
  //decission pending what you do with data
  alert( "Data Saved: " + msg );
});

HTML
<input type="text" id="txtId" onchange="getData()" />

You need to add jquery ajax library to your page/masterpage/site. You can also use CDN.
 
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