I have asp.net usercontrol and I should implement simple client functionality – send two numbers to the server. I use devexpress, which allow me to send only one string on callback to server. So I don’t want to invent a wheel and just use JSON.stringify method.
<script type="text/javascript" src="https://raw.github.com/douglascrockford/JSON-js/master/json2.js"></script>
<cc1:Button runat="server" ClientSideEvents-Click="
function(s,e)
{
cbpanelCtrl.PerformCallback(JSON.stringify({width: 800, height: 600}));
}"
Text="Reload"
AutoPostBack="false">
Everything works fine in firefox but error raised in IE: Microsoft JScript runtime error: ‘JSON’ is undefined
Why? How should I load script properly?
Turned out that I just use wrong library. I used old version which is not supported by IE. Everyting fine with recent version here http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js