Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 18-Aug-12 8:54am
v2
Comments
[no name] 18-Aug-12 15:55pm    
Well if it were me, I would use an INSERT statement.
Nandakishore G N 20-Aug-12 1:02am    
Thanx..for the suggestion..Wes Aday..Bcoz,I had Already done That Part Using Button Click..Using as Same As Ur Suggestion..i.e,"Insert" Stmt.
the insert stmt can be executed..but,i need it during enter key press..

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 )
 
Share this answer
 
Comments
Nandakishore G N 20-Aug-12 1:04am    
Thanx...Graus..Can u get Me an example..I tried this using javascript..Keyup event..but,i couldnt get the id of the textbox..inside gridview..i.e,is the problem.
I knew this post is very old...
but in case any1 wanted it


JavaScript
$("#id_of_textbox").keyup(function(event){
    if(event.keyCode == 13){
        $("#id_of_button").click();
    }
});




Salah
Osmosys
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900