Get sever site data using jq
public partial class handlerPage : IHttpHandler
{
bool IHttpHandler.IsReusable
{
get
{
return false;
}
}
void IHttpHandler.ProcessRequest(HttpContext context)
{
// throw new NotImplementedException();
System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();
string ResultString = string.Empty;
List<CharEntity> Lst = new List<CharEntity>();
Lst = GetDataFromList();
ResultString = js.Serialize(Lst);
context.Response.Write(ResultString);
}
}
public List<CharEntity> GetDataFromList()
{
List<CharEntity> Lst = new List<CharEntity>();
for (int x = 0; x <= 2; x++)
{
Lst.Add(new CharEntity
{
TaskName = Task[x],
TaskValues=val[x]
});
}
}
function getChart(val) {
var ChartData = GetChartData();
}
function GetChartData() {
try {
var Task1 = new Array();
var url = "/_layouts/15/Igrid_Petronash/handlerPage.ashx";
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", url, false);
xmlHttp.send(null);
var layerHTML = xmlHttp.responseText;
var msg1 = JSON.parse(layerHTML);
return msg1;
}}
public partial class handlerPage : IHttpHandler
{
bool IHttpHandler.IsReusable
{
get
{
return false;
}
}
void IHttpHandler.ProcessRequest(HttpContext context)
{
// throw new NotImplementedException();
System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();
string ResultString = string.Empty;
List<CharEntity> Lst = new List<CharEntity>();
Lst = GetDataFromList();
ResultString = js.Serialize(Lst);
context.Response.Write(ResultString);
}
}
public List<CharEntity> GetDataFromList()
{
List<CharEntity> Lst = new List<CharEntity>();
for (int x = 0; x <= 2; x++)
{
Lst.Add(new CharEntity
{
TaskName = Task[x],
TaskValues=val[x]
});
}
}
function getChart(val) {
var ChartData = GetChartData();
}
function GetChartData() {
try {
var Task1 = new Array();
var url = "/_layouts/15/Igrid_Petronash/handlerPage.ashx";
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST", url, false);
xmlHttp.send(null);
var layerHTML = xmlHttp.responseText;
var msg1 = JSON.parse(layerHTML);
return msg1;
}}