On the server side, I assign the click event of a button
closeWindow.OnClickFunc = String.Format("CloseWindow('{0}');", "{\"codeA\":\"MALE\",\"codeB\":\"SomeCodeB\"}");
When I examine the rendered HTML, it's completely malformed:
<img onclick="CloseWindow('{" src="close.jpg" id="closeLink">
To debug the issue, I got rid of the double quotes in the json string
closeWindow.OnClickFunc = String.Format("CloseWindow('{0}');", "{codeA:MALE,codeB:SomeCodeB}");
Now the HTML is as expected:
<img onclick="CloseWindow('{sectionCodeDB:NEWS,sectionCodeDBNew:NEWS,itemType:REMINDER}');" src="close.jpg" id="closeLink">
So, there's some issue with the double quotes that's messing the HTML.
Any thoughts on how to pass the JSON string?
String.Format("CloseWindow({0});", "{codeA:'MALE',codeB:'SomeCodeB'}")? (if you useJSON.parseinCloseWindow, you don't need that anymore)