Thursday, August 29, 2013

ASP.Net Telerik RadScriptManager causes Sys not defined error

I ran into issue where I was working on a website with page methods (svc) and so I was using ScriptManager to register them. All was working fine until I decided to include Telerik ASP.Net AJAX control as well. I switched from ScriptManager to RadScriptManager, added all the web.config settings, but when I loaded the page in browser, I was getting all sorts of  "Sys is not defined" errors.
One thing in particular was puzzling - when I looked in browser's dev tools at the content of the "WebResources.axd?....", I was getting HTML code instead of JavaScript.
Finally I realized where the problem was - I was using Forms authentication and did not put the WebResource.axd to the exceptions list... doh!
So make sure you have the below in your web.config:

  <location path="Telerik.Web.UI.WebResource.axd">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>


No comments: