public void ProcessRequest(HttpContext context) { int id = Convert.ToInt32(context.Request["id"].ToString()); context.Response.ContentType = "application/json"; CargosBL cargosBL = new CargosBL(); Cargos c = cargosBL.buscarCargo(id); context.Response.Write(string.Format("{{ \"cargosID\" : \"{0}\", \"Descripcion\" : \"{1}\"}}", c.cargosID, c.Descripcion)); //context.Response.Write(JsonConvert.SerializeObject(c)); context.Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { } cargosBL = new CargosBL(); gvCargos.DataSource = cargosBL.listadoCargos(); gvCargos.DataBind(); }