控制接受覆盖的输入 [英] Control to accept overwriten input

查看:52
本文介绍了控制接受覆盖的输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框和一个按钮.每次我在文本框中输入内容时,都应将其添加到文本框下方的控件中,并覆盖输入.
现在我应该使用什么控件来接受输入?

I have a textbox and a button. Every time I enter stuff in my textbox, it should be added in a control below the textbox and override the input.
Now what control should i use, that will accept the input?

推荐答案



您可以使用javascript做到这一点,只需将文本添加到div就可以解决问题,或者,如果您更喜欢使用代码隐藏,则可以使用列表控件,并在运行时添加包含文本框最后值的文字.

希望我能理解您的问题...
Hi,

You could use javascript to do so, just add your text to a div should do the trick, or if you prefer using codebehind I''d use a list control and add literals containing the last value of your textbox at runtime.

I hope I understood your question...


您可以使用TextBox添加onChange属性,该属性将调用JavaScript方法.
TextBox1.Attributes.Add("onchange", "JSMethod();");
在该特定方法上,您可以通过获取当前文本框的值来覆盖其他控制文本.
You can add an Attribute of onChange with the TextBox, that will call a JavaScript method.
TextBox1.Attributes.Add("onchange", "JSMethod();");
On that particular method you can override the other control text by getting the value of current textbox.


这篇关于控制接受覆盖的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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