I am trying to make update inline with x-exditable latest version in MVC.
My View:
<a href="#" data-type="text" data-pk="@Model.KimlikBilgileri.id" id="adi" data-url="@Url.Action("InlineEdit","Yonetim",new { @id=@Model.KimlikBilgileri.id))" data-title="adi">@Model.KimlikBilgileri.adi</a>
"
My Controller:
[HttpPost]
public ActionResult InlineEdit(int id,string adi)
{
var user = db.kimlik_bilgileri.Find(id);
user.adi = adi;
db.SaveChanges();
return new HttpStatusCodeResult(HttpStatusCode.OK);
}
Here is my JS:
<script>
$.fn.editable.defaults.mode = 'inline';
$('#kimlikbilgileri a').editable({
type:'text',
});
</script>
I cant send "adi" value in Url.Action()
section. id
is passing but adi
doesn't. Do I have to use Json
? If so how can I?
i tried many ways to solve this problem. Now I solved it. your link needs to be has the parameters that you want to send. and in your controller you have to set "string value" as parameter. After that the problem solved by now. Thanks for everyone.