Search code examples
jqueryasp.net-mvcjson.netx-editableinline-editing

Asp .Net MVC and x-edtable sending more than 1 valuee


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?


Solution

  • 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.