0

I have an ASP.NET web application that I'm trying to run as a sub folder of ISV in CRM 4.0.

I have deployed my app with the following structure:

ISV\
   MyAppName\
      *.aspx
      web.config
      bin\
         *.dll

I have not created a new IIS application at MyAppName. My aspx files all being with a <%@ Assembly Name="MyAssembly" %> tag. The pages load correctly with code-behind being executed as expected.

My problem occurs when calling a page method from JavaScript. The ScriptModule does not seem to be loaded as my request to MyPage.aspx/MethodName returns the entire page markup.

My code-behind and JavaScript are both correct and I have verified this by creating an application at MyAppName and accessing the url using /ISV/MyAppName rather than /Orgname/ISV/MyAppName.

How can I make ScriptModule load and work as expected when being accessed through /Orgname/ISV/MyAppName?

Matt
  • 4,656
  • 1
  • 22
  • 32
Matt
  • 995
  • 1
  • 8
  • 18

1 Answers1

2

As noted in this question, I believe this is happening because CRM's web.config doesn't specify System.Web.Handlers.ScriptModule as an httpModule. Your custom web.config probably does, so when you create an IIS app for it the httpModule gets loaded and your page method works. Without the IIS app, I believe most of your custom web.config gets ignored. I would try two things:

1) Remove your custom IIS web app. Add System.Web.Handlers.ScriptModule to CRM's web.config in the httpModules node. That would look something like this:

<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

(Note that modifying CRM's web.config is not supported and can be a pain if an update rollup overwrites CRM's web.config and blows away your changes.)

2) Write a separate webservice to perform the work of your page method. It would have to live in a separate custom web app.

Community
  • 1
  • 1
Polshgiant
  • 3,595
  • 1
  • 22
  • 25
  • 2
    My aim is to stay on the supported side. I've now moved my page method into a web service. This currently lives in the same ISV folder and runs as part of the CRM application. This works so far (I gave up at 5 on Friday) however I'm having to load up my appSettings manually using WebConfigurationManager.OpenWebConfiguration. – Matt Jan 29 '11 at 10:38
  • I ended up writing an ashx handler that acted as a web service and ran in the CRM application under the ISV folder. – Matt Mar 16 '11 at 11:50