Click here to Skip to main content
15,885,546 members

Comments by Phionix11 (Top 12 by date)

Phionix11 21-Jul-14 5:34am View    
If i dont use update panel it postback the whole page....
Phionix11 21-Jul-14 5:33am View    
not working even using Triggers with Asynchronous tag in it.
Phionix11 20-Nov-13 9:42am View    
reading data of csv file from http://192.168.101.10/logs/abc wont work.....how can i achieve in VB.NET code, as I used directoryinfo for this but it cannot be used for URL'S.
Phionix11 1-Jul-13 17:27pm View    
Below is response result that I get,when there are multiple records then it shows json array,when there is only 1 record then it shows json object and if there is no record then it shows null.

Example 1]Response:-
{
"success":true,
"message":null,
"result":
{
"TravelData":
[
{ "travelMode":"Bus","Distance":"30" },
{ "travelMode":"Car","Distance":"22" },
{ "travelMode":"Cycling","Distance":"24" },

],

"HomeHeatingData":
[
{ "billType":"Electricity","amount":"650" },
{ "billType":"Phone","amount":"300" }
],
"FootPrintData":
{ "userId":"147",
"Saved":"12.76",
"Produced":"35084.55"
}
}
}

Example 2]
Response:-
{
"success":true,
"message":null,
"result":
[
{"date":"2013-05-24","Produced":"854.93","Saved":"0.02"},
{"date":"2013-05-25","Produced":"854.93","Saved":"0.28"},
{"date":"2013-05-28","Produced":"854.93","Saved":"0.17"},
{"date":"2013-05-30","Produced":"857.82","Saved":"3.45"},
{"date":"2013-05-31","Produced":"862.61","Saved":"0.00"}

]
}
Phionix11 1-Jul-13 16:19pm View    
Here is my code, of JsonResponse file

class JsonResponse{
public $timestamp;
public $success;
public $message;
public $result;

function __construct($success, $errorMessage, $result){
$this->timestamp=gmdate('Y-m-d\TH:m:s\Z');
$this->success = $success;
$this->message = $errorMessage;
$this->result = $result;
}
}

and in another file i use this to send response result back,

echo json_encode(new JsonResponse($this->success, $this->message, $this->result));

here "$this->result" contains actual result from mysql