This seems simple but I just cannot get it.
I have an asp.net page, with the following credentials:
- 1 button
- 1 textbox
- 1 repeater
*Now when I type a text in my textbox, I passed the text to a web method using jquery ajax,
which inserted the text into the database.
Now I have a public method in my code behind thta selects the data from the database and bind it to a repeater.
How do I display this this repeater on every data insert without a postback?*
success: function (data) {
for (var i = 0; i < data.d.length; i++) {
$("#tbDetails").append("<tr><td>" + data.d[i].ID + "</td><td>" + data.d[i].ChargeName + "</td><td>" + data.d[i].Description + "</td></tr>");
}
},
error: function (result) {
alert("Error");
This is a little sample, I guess you can ignore the Insert part since you said you already have it. This uses jQuery, which you also are using.
HTML:
ASP.NET:
Good luck!
Edit: Now you can also see a delete sample, which includes passing an argument to the webmethod. Good luck.