asp.net 服务器端的 TextBox keydown 事件
我在页面上有一个文本框,现在每当在该页面中输入任何年龄数字时,该页面都应该加载到我的数据列表中,我已经创建了其余的内容,但我不知道如何从 asp 触发文本框 onkeydown 事件.net,我知道可以通过 javascript 使用它,但问题是我在该函数中完成了以下操作:
,我不认为我可以通过javascript做到这一点,任何人都有任何解决方案,如何从服务器端实现这一点,onkeydown事件
i have a textbox on a page, now whenever any age number is entered in that page, that page should be loaded in my datalist, i have created rest of the thing, but i am not getting how to trigger the textbox onkeydown event from asp.net, i know working with that from javascript, but the problem is i have below things done in that function:
and i dont think this i can do from javascript, anyone have any resolution, how this could be achieved from server side, onkeydown event
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 JavaScript 函数中捕获 keydown 事件,然后对服务器进行 AJAX 调用。如果这不适合您,那么您可以尝试在 javascript 中手动进行回发。
因此,在您的文本框中:
现在在 javascript 函数中:
可以在此处找到更多信息:
You can capture the keydown event in a javascript function then do a AJAX call to the server. If this does not suit you, then you could try manually do postback in javascript.
So in your textbox:
Now in the javascript function:
More info can be found here:
尝试查看或使用:
AJAX Control Toolkit,或
JQuery Autocomplete Plugin
或者,您可以尝试从客户端事件/函数为文本框调用 _postback() 函数javascript
Try looking into or using either:
AJAX Control Toolkit, or
JQuery Autocomplete Plugin
Alternatively you could try to call _postback() function from a client side event/function for your textbox in javascript