Hi Team,
Passing only strings from Controller to View in AJAX is working fine.
Passing only list from controller to view is also working fine.
I need to pass both strings and list in single method to AJAX.
I had used the below way.
In Controller:
var Activitylist = new SelectList(drpActivityCode, "ActivityCode", "ActivityCode");
string Groupno = distinctActivity.Rows[0]["GroupNo"].ToString();
string ActivityDesc = distinctActivity.Rows[0]["ACTIVITYDESCRIPTION"].ToString();
return Json(new { Groupno=Groupno, ActivityDesc= ActivityDesc, Activitylist= Activitylist }, JsonRequestBehavior.AllowGet);
In View:
function onProjectCodeChange(val) {
var projectcode = val;
$.ajax({
type: "GET",
url: "/ProjectUpload/GetGroup",
data: { projectcode: val },
dataType: "json",
success: function (reponse) {
var Groupno = reponse.Groupno; var ActivityDesc = reponse.ActivityDesc;
alert(Groupno);
alert(ActivityDesc);
var Activitylist = response.Activitylist;
alert(Activitylist);
}
});
}
Activitylist is not getting here.
Let me what thing i missed here.
Thanks in Advance.