Thursday, May 20, 2010

Enterprise Portal: Adding an AX Web Control and Resolving the “unable to load content” Error

Following the tutorial on creating a web part page for Enterprise Portal in the book “Microsoft Dynamics AX 2009 Programming: Getting Started” by Erlend Dalen (Great book by the way!) things seemed simple enough from creating a dataset in AX (page 290) to creating the web part in Visual Studio (pages 291-295). Even the first steps of creating the web part page was straight forward (296-299). However, because my development environment was in 64-bit Windows, when it came to modifying my shared web part, to use the web part that I built in Visual Studio, one additional key step was needed. At first I received the following error message:


'unable to load content [webcontrol name]. Please contact your systems administrator'

Finding Out What The Actual Problem Is

In order to get to the bottom of what was actually going on, I learned that I needed to modify my main web.config file which is located at:

C:\Inetpub\wwwroot\wss\VirtualDirectories\80

to give me a more useful message.

1) First, I needed to modify the following line that begins with:

SafeMode MaxControls=”200” CallStack=”false” …

And change the CallStack property to “true

2) Next, I needed to modify the following line:


customErrors mode=”On” /

And change the mode property to “Off

3) Next, I needed to modify the following line:

compilation batch="false" debug="false"

And change the debug property to "true"

4) I then saved the the web.config file
5) Restarted IIS by executing the IISRESET command in the command prompt
6) Went through the steps of creating the web part page again.
7) I then received a far more useful error, with the first line of the error telling the story:


System.Web.HttpException: The file '/_layouts/ep/[webcontrol name].ascx' does not exist.

The Missing Step

Now knowing that the problem was that my control files didn’t actually exist where SharePoint expected them, I needed to locate the exact path where these files belonged. As it turns out, after searching, the “/_layouts/ep” path is not a physical path on the machine, so I had to find its physical location some other way. How I did this was searching the hard drive for another AX web part that was in the list of webparts that I verified was able to load (so I searched for “ActivitiesListAssociations”). This led me to the physical path of:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\ep

As expected, my custom web control files were not there.

So I copied the .ascx and .ascx.cs files from my project to this path, went through the steps to create the web part page, and web part finally loaded!

22 comments:

  1. Nice article,just a note here that you can get away with this manual workaround by changing code in SysEPdeployment class. refer to EP Devcookbook for details

    ReplyDelete
  2. Hi..

    My requirement is to add new chart control in Dynamics AX web page.. But while adding it in EP web part page its showing the error as "Unable to load content. Please contact your system administrator"
    I tried all the way you specified.. But it didn't worked out for me. Will you please tell me whether is there any alternative way to rectify this error?

    Thanks

    ReplyDelete
  3. Greatly appreciated. It is great to be able to see what the error is!

    Thanks.

    ReplyDelete
  4. Very nice post. i found it very useful.
    thanks for spending time on it. it has better understanding.
    i appreciate for you and very useful this your information


    Web Development Dubai

    ReplyDelete
  5. Hi,There is a lot of debate when it concerns the best Web Design Cochin. There are those that think the best business web page design is one filled with all kinds of graphics and data while others will advocate a more sleek and streamlined web page.Thanks......

    ReplyDelete
  6. This is very useful post. Greatly appreciated. It is great to be able to see what the error is! Web Design Manchester

    ReplyDelete

  7. If its useful do not forget to subscribe to get future update on SSRS Reports tips and Ax ERP
    if You dont want to subscribe please share with your friends or group to encourage me to post more
    But if you will subscribe then you will get update throug email also.

    https://www.youtube.com/watch?v=angepuP_ICc

    Ax blog

    daynamicsaxaptatutorials.blogspot.com

    ReplyDelete
  8. Thanks for share the quality content, Yasir jamal is a team of highly skilled professionals, dedicated to bring out the best designs for your brand. At Dubai web desinger Services page, creativity is taken to new levels as each and every mind here strives to craft your vision into reality.

    ReplyDelete
  9. That's really a marvelous post. This post contains useful information which helps us a lot. I have never seen such a great post. Your wonderful post can inspire a lot and helps us. I visit your website often and share with my friend.
    Nadkaar - Dubai Website Design

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. helpful content, i was looking for these tips since long, thank you so much for making it easy for me.
    SEO Dubai

    ReplyDelete
  12. Really an interesting and amazing post. Thanks for sharing this wonderful informative article here. I appreciate your hard work.Website Designing Company Bangalore | Web Development Company Bangalore

    ReplyDelete
  13. Your posts are always source of new information for me. Thanks for sharing great posts with us.
    SEO Dubai

    ReplyDelete
  14. I want to appreciate the efforts you put in while writing this blog. Great posts.
    AC repair Dubai

    ReplyDelete
  15. Mark Williams is a fully licensed recruitment firm currently focused on fulfilling clients’ needs in; Emiratisation, Financial Services and Information Technology related positions within the United Arab Emirates and the GCC.

    ReplyDelete
  16. This is exactly what I needed to read today. Your insights are spot on.


    SEO, PPC, SMM, Web Design & Development Agency Dubai

    ReplyDelete
  17. Hire a Expert Advocate to Solve Your Family Suit in Pakistan. Our Main Family Services are Given Below:


    Khula Case in Pakistan


    Divorce Procedure


    Talaq Procedure


    ReplyDelete
  18. Hire a Quick Process Server Onlinefor Attested and server your legal Papers. We are one of the Best and Top Lawyer for quick Process Server Services.

    ReplyDelete