how can i call code behind function through java script function (help plz)
-
iam having a textbox in that i write some text and press enter then a function should execute .
You can use AJAX to execute a server side function
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
iam having a textbox in that i write some text and press enter then a function should execute .
jagadeeshkumar2106 wrote:
how can i call code behind function through java script function (help plz)
maybe. you can use ajax.
function fireFunc() { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { **var req = false; // Mozilla/Safari if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } req.open('POST', "http://urdomain.com/urpage/aspx", true); req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); req.onreadystatechange = function() { if (req.readyState == 4) { // req.responseText } } req.send("querystring");** } } <input type="text" value="Check Answer" onkeypress="fireFunc()" >
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
iam having a textbox in that i write some text and press enter then a function should execute .
You will have to put your function/procedure in a page and this page needs to be called as specified by Michael Sync. You can send any value to it using the querystring.
Nav
-
You can use AJAX to execute a server side function
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
hi navaneeth how ru ... this is id by writting the code in server button click .and i called the button click in javascript like this var obj obj=document.getElementById("btngetdata"); obj.click(); still its not getting is any other with out using ajax
I have created one library which will help to call button event when enter key is pressed. Check this[^] and download the library
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
You can use AJAX to execute a server side function
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
You can write in page load.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions
-
You can write in page load.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions