Hi,
I have question to update Textarea real time?
When I update any changes in Textarea, it automatically update Database real time.
I tried to use Ajax, it is not working, please look at my Source code and check it.
@Html.TextAreaFor(m => m.Contents, new { @rows = "18", @cols = "40" , @Id= "textbox1" })
<script type="text/javascript">
$("#textbox1").change(function () {
$.ajax({
url: '@Url.Action("Edit01", "EmpInput")',
type: "POST",
data: { id = @Model.ID }
}).done(function (result) {
var html = result.NumberOfLikes;
document.getElementById("GetLikeValues").innerHTML = html;
});
}
</script>
[HttpPost]
public JsonResult Edit01(int id)
{
var Username5 = User.Identity.Name;
var ok1 = db.Users.Where(x => x.UserName == Username5).FirstOrDefault();
var article = db.GMIdeas.Where(x => x.Id == id).FirstOrDefault();
var NAme001 = "";
if (ok1 != null)
{
}
return Json(db.Todolists.Where(x => x.ID == id).FirstOrDefault());
}