如何调用文本框的服务器端函数onblur和ontexhchange事件 [英] how to call serverside function onblur and ontexhchange event of textbox

查看:88
本文介绍了如何调用文本框的服务器端函数onblur和ontexhchange事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


我试图在textchange上调用服务器端函数和动态生成文本框的onblur事件。我可以在这个event.provide解决方案上调用服务器端函数。

thanx.hv a greate day。

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.

推荐答案

你需要使用ajax。您可以使用jquery库进行ajax通信。例如



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

function getData(){


.ajax({
type: POST
url: test.aspx // 您也可以使用任何网络方法
data:{name: John location 波士顿} // 参数如果你想发送任何
})。done( function (msg){
// decission等待您对数据的处理
alert( 数据保存: + msg);
});
.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 ); });




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



您需要将jquery ajax库添加到您的页面/母版页/站点。您也可以使用CDN。


You need to add jquery ajax library to your page/masterpage/site. You can also use CDN.


这篇关于如何调用文本框的服务器端函数onblur和ontexhchange事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆