Hi everyone. I'm a newbie and i'm developing a web app in c# and asp.net that shows charts dinamically. I managed to pass JSON string from c# code to the asp.net one using the ViewState and I want to create my chart using "pushJSONChartCreate". to do this i have to import the nocache.js library like this:
<script language="javascript" type="text/javascript"
src="QCSPCChartGWTWar/qcspcchartgwt/qcspcchartgwt.nocache.js"></script>
(the src is correct, because the folder "QCSPCChartGWTWar" is in the main web folder).
this is the asp.net code:
<script language="javascript" type="text/javascript">
window.onload = function setData() {
console.log("loaded");
var stringa = document.getElementById('stringa_json').value;
alert(stringa);
pushJSONChartCreate(JSON.stringify(stringa));
}
</script>
this is the c# code:
String JSONfinale = generaStringa(stringaJSON);
ViewState.Add("json_code", JSONfinale);
Page.ClientScript.RegisterHiddenField("stringa_json",
ViewState["json_code"].ToString());
the asp.net code shows in an alert the JSON string passed succesfully with the ViewState, so the application enter in this block of code, but in browser console I see this error:
Uncaught ReferenceError: pushJSONChartCreate is not defined
at setData (Alessio.aspx:18)
setData @ Alessio.aspx:18
Anyone can help me?
Thank you,
Alessio