You want to use the database as you type into one textarea
of html, right?
If yes, you will need to use the AJAX.
There are some methods to capture user typing in the DOM: onKeyUp
and onKeyDown
are examples.
Theoretically, at each keystroke you must send such information to the database - and here you must worry about performance - causing him to update something there.
Imagine this as an ordinary AJAX, only instead of you sending the information through a typical post, you would be doing it through another type of trigger.
I made an example for you:
$('form textarea').on('keyup', function () { // quando você pressionar uma tecla no textarea...
var $data = $(this).serialize(); // serializa a informação digita em uma variável
$('.report').html($data); // exibe a informação serializada/digitada na div .report
/**
* depois, envia através de uma requisição post
* as informações para '/path/to/action',
* sendo tal endereço uma action do seu backend
* escrito em C#.
*
* Lembrando que este backend tem a responsabilidade
* de fazer a operação de banco de dados
* que você deseja.
*
* Caso consigamos acessar a action, você cairá na função
* 'success', onde imprimiremos no console
* a resposta enviada pelo servidor.
*/
$.ajax({
type: 'POST',
url: '/path/to/action',
data: $data,
success: function (response) {
console.log(response);
}
});
});
If you want to play, he’s available here, in jsFiddle.
You will need jQuery to run the example.
It would be interesting more details like: what have you done? What haven’t you done? Do you have any idea how to do it? A little bit of your code would also help.
– Guilherme Oderdenge
The ASP.NET application is Webforms or MVC ?
– Guilherme de Jesus Santos
Forgive my ignorance, but what it means to "trigger"?
– ricidleiv
@ricidleiv It is "shoot" in Portuguese of Portugal (think of a fuse). I learned from Zuul in chat :)
– bfavaretto