SHARE
TWEET

Untitled

a guest Jul 21st, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $.ajax({
  2.     type: "POST",
  3.         url: '@Url.Action("ProbarDatos", "Charlas")',
  4.         data: { prueba: JSON.stringify ([{ p1: "perro", p2: "gato" }, { p3: "pez", p4: "raton" }]) },
  5.     dataType: "json",
  6.     success: function (rpta) {
  7.         alert(rpta);
  8.         console.log(rpta);
  9.     },
  10.     error: function (req, textStatus, errorThrown) {
  11.         alert('Ooops, something happened: ' + textStatus + ' ' + errorThrown);
  12.         }
  13.     });
  14.      
  15. [HttpPost]
  16.     public JsonResult ProbarDatos(string[] prueba)
  17.     {
  18.  
  19.         return Json(prueba);
  20.  
  21.     }
  22.      
  23. ["[{"p1":"perro","p2":"gato"},{"p3":"pez","p4":"raton"}]"]
  24.      0: "[{"p1":"perro","p2":"gato"},{"p3":"pez","p4":"raton"}]"
  25.      length: 1
  26.      __proto__: Array(0)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top