jeudi 21 avril 2016

Loading Partial view in ajaxified way

I am trying to load a partialview using ajax method. Since I have tried it in past but I dont know why this time it is not loading the content and data. I am wondering that where I am wrong. How can I correct this? please help asap

This is my view having partial view in one of its div named "Add_Group".

    .Title("Edit Group")
    .Content(@<text><div id="Add_Group" style="display:none; width:100%;">
        </div> </text>)

After I get data using post as below I am trying to load that patial view using below:

$.post("/UserGroups/getGroupDetail", { "groupId": id }, function (response) {

in controller it is like below:

 public ActionResult GetGroupDetail(string groupId)
            var data = string.Empty;
            UserGroupRoleModel objmodel = new UserGroupRoleModel();
            var groupEntity = this._userGroupServices.GetGroupDetail(Convert.ToInt32(groupId));
            return this.Json(new { Data = groupEntity });

Aucun commentaire:

Enregistrer un commentaire