I am new to jQuery. I have a jQuerypiece of code which assign PAN Name to label which return from c# dictionary after conversion in JSON. When I getting value in alert(Bold Line). It is showing undefined.
Below is my code.
success: function (data) {
var msgi = data.MSG;
var panno;
if (msgi != "A" && msgi != "B") {
alert(msgi); ////// Here undefined is showing
$("#Item3_PANNumber").focus();
$("#Item3_PANNumber").val('');
}
}
/////// This is last part of method.
if (words.Length > 0)
{
PANCard pc = new PANCard();
if (words[0] == "1" && words[2] == "E")
{
pc.PANNumber = words[1];
pc.LastName = words[3];
pc.FirstName = words[4];
pc.MiddleName = words[5];
pc.Title = words[6];
pc.LastUpdated = words[7]; ////DateTime.ParseExact(words[7], @"d/M/yyyy", culture);
var panno = pc.Title + " " + pc.FirstName + " " + pc.MiddleName + " " + pc.LastName;
Returndict.Add("MSG", "B");
return Json(panno, JsonRequestBehavior.AllowGet);
}
}
Your help may appreciated.
Thanks Nandkumar S.
ReturnDictfrom your C# code, orpc, only thepannostring. Unless it's put into the JSON response outside the code shown.