ASP.NET文本框中是否存在OnExit或Leave事件? [英] Is there a OnExit or Leave event on ASP.NET textbox?

查看:92
本文介绍了ASP.NET文本框中是否存在OnExit或Leave事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户离开文本框时,我需要在服务器上运行一些代码,它将对输入的内容进行一些计算.我宁愿避免使用jQuery,因为这将涉及创建JSON服务器等.

I need to run some code on server when user leaves the Textbox, it will do some calculations on what has been typed. I'd rather avoid doing it with jQuery, because it would involve creating a JSON server, etc.

没有办法对这样的事件进行回发吗?

Isn't there a way to do a postback for such an event?

推荐答案

文本框具有 TextChanged 事件以调用一些服务器端代码.

The TextBox has an AutoPostBack property to cause a postback when the user leaves the client-side textbox. There you can use the TextChanged event to call some serverside code.

这篇关于ASP.NET文本框中是否存在OnExit或Leave事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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