public string loginDriver(string uName, string password) { JavaScriptSerializer j = new JavaScriptSerializer(); Drivers d = new Drivers(uName, password); d = d.CheckLoginDetails(); return(j.Serialize(d)); }