It is currently Wed Oct 01, 2014 8:17 pm Advanced search

Problem with getJSON ASP.NET

Technical support for the Highcharts Stock package

Problem with getJSON ASP.NET

Postby Vespia » Fri Nov 11, 2011 1:48 pm

Hallo,

if I use
Code: Select all
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-v.json&callback=?', function(data) {

it works fine.

if I use

Code: Select all
series : [{
              name : 'AAPL',
              data : [
                         [1100131200000,27.65],
                         [1100217600000,27.75],
                         [1100476800000,27.62],
                         [1100563200000,27.47],
                         [1100649600000,27.45],
                         [1100736000000,27.70],
                         [1100822400000,27.58],
                         [1101081600000,30.68]
                        ],
              tooltip: {
               yDecimals: 2
             }
           }]


it works fine.

But if I use my one file it doesn't work.

Code: Select all
$.getJSON('returnfile.aspx?filename=x.json&callback=?', function(data) {


I saved the output from
Code: Select all
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-v.json&callback=?

in a txt-File and on page_load the returnfile.aspx read the txt-File

I tried: MIME-Type: text/javascript, text/json, application/json, text/plain
and Response.WriteFile(x.json)

I tried:
Response.Write(ContentOfTheFileAsString)

But it does't work, I can't see any Chart

if I call the page returnfile.aspx seperately I get the same output like 'http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-v.json&callback=?

I don't understand what is different.
Can you help me?
Vespia
 
Posts: 2
Joined: Fri Nov 11, 2011 10:19 am

Re: Problem with getJSON ASP.NET

Postby Vespia » Fri Nov 11, 2011 6:56 pm

I found my mistake, it was a newbie mistake on json

Code: Select all
Dim callback As String = Request.QueryString("callback")
Response.Write(callback + ContentOfTheFileAsString)
Vespia
 
Posts: 2
Joined: Fri Nov 11, 2011 10:19 am

Re: Problem with getJSON ASP.NET

Postby rodrigo.weme » Fri Feb 17, 2012 4:38 pm

You have an example in asp.net to download?
rodrigo.weme
 
Posts: 1
Joined: Fri Feb 17, 2012 4:36 pm

Re: Problem with getJSON ASP.NET

Postby hfrntt » Wed Feb 22, 2012 6:08 pm

You can look on this forum for some other asp.net solutions. As I remember something was here recently.
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am


Return to Highstock Usage

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests