当按下回车键时,数据必须转到DB,其中txtbox在gridview内 [英] when enter key is pressed the data must go to DB where txtbox is inside gridview
本文介绍了当按下回车键时,数据必须转到DB,其中txtbox在gridview内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个gridview,其中有一个textmode =multiline的文本框。当我按下输入时,文本框中的数据必须转到数据库。我正在使用row_command将数据插入到db中,TextBox处于GridView的itemtemplate模式。
如何插入?欢迎任何建议!
问候,
NanKi
解决方案
因为您的文本框是多行的,所以它将输入视为它使用的键。您需要处理文本框的keyup事件,计算出它是一个输入,并进行AJAX调用以保存您的数据(或回发)
我知道这个帖子很老了...
但是如果任何人想要的话
( #id_of_textbox)。keyup( function (event){
if (event.keyCode == 13 跨度>){
I have a gridview in which there is a textbox with textmode="multiline". When, I press enter the data present in the textbox must go to database. Where I'm using row_command for inserting data to db and the TextBox is in itemtemplate mode of GridView.
How can I Insert it? Any suggestions welcome!
With Regards,
NanKi
解决方案
Because your textbox is multiline, it regards enter as a key it uses. You need to handle the keyup event of the textbox, work out it was an enter, and make an AJAX call to save your data ( or post back )
I knew this post is very old...
but in case any1 wanted it
("#id_of_textbox").keyup(function(event){ if(event.keyCode == 13){
这篇关于当按下回车键时,数据必须转到DB,其中txtbox在gridview内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文