I have created an API that returns in json a list of type EventJOINEventDate. I am now trying to write a web form that calls the API and shows the Events from the json file in a table. The web form has 2 inputs: input_date and input_num. I wrote this far but am now stuck and don't know how to proceed. How do I use what I wrote to create an html table?
string StartDate = input_date.ToString();
string Num = input_num.ToString();
string url = String.Format("Http://..."); //I have my url here
WebRequest requestObj = WebRequest.Create(url);
requestObj.Method = "GET";
HttpWebResponse responseObj = null;
responseObj = (HttpWebResponse)requestObj.GetResponse();
string strresult = null;
using (Stream stream = responseObj.GetResponseStream())
{
StreamReader sr = new StreamReader(stream);
strresult = sr.ReadToEnd();
sr.Close();
}
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
List<EventJOINEventDate> EventList = (List <EventJOINEventDate>)serializer.Deserialize(strresult, typeof(List<EventJOINEventDate>));
foreach(EventJOINEventDate obj in EventList)
{
long EventID = obj.EventID;
DateTime StartDateTime = obj.StartDateTime;
string EventName = obj.EventName;
string EventDesc = obj.EventDesc;
string Address1 = obj.Address1;
string Address2 = obj.Address2;
string City = obj.City;
string State = obj.State;
string Zip = obj.Zip;
string EventURL = obj.EventURL;
string RegistrationURL = obj.RegistrationURL;
string InvitationURL = obj.InvitationURL;
}