用于捕获用户键盘敲击的文本框
在其中一个页面上,我需要添加一个文本框,用户可以在其中输入文本。对我们来说,捕获用户在输入文本时的想法非常重要,因此应该捕获退格键、按键等笔划。一旦用户单击提交按钮,管理员应该能够“播放”操作并查看用户在输入文本时的进度(类似于观看视频)
什么是 asp.net mvc 或 webforms这样做的方法?
On one of the pages, there is a need for me to add a textbox in which the user types in text. It is important for us to capture what the user is thinking while he's typing in the text, so strokes such as backspace, keys should be captured. Once the user clicks on the submit button, the administrator should be able to 'play' the actions and review how the user progressed while he was typing in the text (similar to watching a video)
What would be the asp.net mvc or webforms way of doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
考虑另一种非控制方法,或者将其包装到新的控制中。
或
。使用 JavaScript KeyCode (这是另一个在浏览器之间 JavaScript 存在一些差异的)。该文章底部有一个很好的示例。使用您自己的分隔符将每个 keyCode 附加到值。 您将得到34|73|91|13|
Consider another non-control approach, or wrap this into your new control.
<input type='hidden' />
or<asp:Hidden>
. Use the JavaScript KeyCode (here's another with some differences in JavaScript between browsers). There's a great sample at the bottom of that article. Append each keyCode to the value with your own separator. You'll end up with34|73|91|13|
我不知道是否有一个自定义控件已经做到了这一点,一般来说,我认为您可以通过这种方式实现您的需求:使用 ClientSide OnKeyPress 事件保存所有按键,将所有按键代码放入列表中,当用户单击提交时将此列表传递给服务器端代码,然后您可以简单地以相同的顺序重新应用所有这些更改,这就是您想要播放的视频:)
I do not know if there is a custom control which already does this, in general I think you could implement your need in this way: save all key press with ClientSide OnKeyPress event, put all the key codes in a list, when user clicks submit pass this list to the server side code then you can simply re-apply all those changes in the same order, this is the video you wanted to play :)