i am write one javascript function
as below
i want to pass the a value to the my code behind .how i pass it
function myKeyPress(e) {
var keynum;
if (window.event) { // IE
keynum = e.keyCode;
} else
if (e.keyCode==13) { // Netscape/Firefox/Opera
keynum = e.which;
alert(String.fromCharCode(keynum));
}
else if (e.keyCode == 65) {
return false;
}
var a = String.fromCharCode(keynum);
}

Abhijit PatilPosted Apr 14, 2015, 1:46 AM
Gowtham RajamanickamPosted Apr 12, 2015, 12:28 PM
Manoj BhoirPosted Apr 12, 2015, 12:21 PM
You can do it using Ajax: http://en.wikipedia.org/wiki/Ajax_%28programming%29
One convenient way of using Ajax is using jQuery .Ajax(): http://api.jquery.com/jquery.ajax/
Or you can do so using Hidden Field.
Create a hidden field variable in the client side as
In the javascript you can assign some value to the hidden variable as
and you can read the hidden field variable in the code behind as
string variable = hdnfldVariable.Value;
I hope this will help you.
ramya bharathPosted Apr 12, 2015, 10:50 AM