skip to Main Content

the datasource for gridview Gridview1 didn't have any properties or attributes from which to generate columns. Ensure that your datasource has content – Asp.net

This is the error I'm getting. The data is being retrieved through WebAPI, but due to a gridview setting, it is not displaying the retrieved data. protected void Page_Load(object sender, EventArgs e)       {           try           {               var webRequest = (HttpWebRequest)WebRequest.Create("https://localhost:44342/api/author");               var webResponse = (HttpWebResponse)webRequest.GetResponse();               if ((webResponse.StatusCode == HttpStatusCode.OK) && (webResponse.ContentLength > 0))               {                   var reader = new StreamReader(webResponse.GetResponseStream());                   string s = reader.ReadToEnd();                   var arr = JsonConvert.DeserializeObject<JArray>(s);                   //Console.WriteLine(arr);                   GridView1.DataSource = arr;                   GridView1.DataBind();…

VIEW QUESTION
Back To Top
Search