Search code examples
javascriptasp.netajaxascxaspx-user-control

Sys.Application.add_init error in dynamic code


I am at a loss, and somewhat out of my depth. There is an older application that I have inherited, and my attempts to get it up and running have met with partial success. The extremely odd behavior I am seeing seems to be related to Internet Explorer 11, as my partial successes have been in Chrome and Firefox. When the application is executing, I receive a JavaScript error, that a } was expected. Upon looking at the code, I am in login.aspx [dynamic] (Visual Studio 2013 Ultimate - forgot to mention). The code that is causing the problem is:

Sys.Application.add_init(function() {
$create(SomeType.Web.WebControls.BasePageBehavior, 
{"id":"SomeControl_callbackExtender","processorStateDataId":"SomeCo="ntrol_callbackExtender_psdh","exceptionPageUrl":"/ExceptionInformation.aspx"}, 
null, 
null, 
$get("SomeControl"));});

As can be seen, for the Properties, the value =" has been inserted into the middle of the JSON object. I have no idea why, although I'm leaning towards something out of date, or at least, out of date for IE 11.

All the scripts seem to go through the proper process of being registered (ScriptManager.RegisterStartupScript), so... ? I've never heard of this, nor was I able to find anything like it on the web. Any thoughts or help is appreciated.

Final thoughts, I have set IE11 to run this site in compatibility mode. That got me to the point of being able to see the error.


Solution

  • Found the work around, although I haven't figured out the WHY yet... It was in this other issue: Visual Studio 2013 produces garbled/corrupted/wrong-encoded html.