protected void Page_Load(object sender, EventArgs e) { try { client = new WSAnimales.WS_AnimalesClient(); string fileJSON = client.consultaAnimales(); DataTable dt = (DataTable)JsonConvert.DeserializeObject(fileJSON, typeof(DataTable)); GridView_Animales.DataSource = dt; if (!IsPostBack) { GridView_Animales.DataBind(); cambiarContenido(); } } catch (Exception ex) { Response.Write("<script language=javascript> alert('" + ex.Message + "'); </script>"); } }
protected void GridView_Animales_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView_Animales.PageIndex = e.NewPageIndex; GridView_Animales.DataBind(); }