Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 10 of 10

Thread: admin.menu.loaderror on precomplied site 9.0.1.3 ML

  1. #1
    PghKid is offline Junior Member
    Join Date
    May 2007
    Posts
    23

    Default admin.menu.loaderror on precomplied site 9.0.1.3 ML

    I recently precompiled the site for better performance, and we are on 9.0.1.3 ML, and the "public" site works fine, but when I run the back office, the menu bar does not load and I get this message

    admin.menu.loaderror


    Any ideas how to resolve this?

  2. #2
    rkratt007 is offline Junior Member
    Join Date
    Oct 2010
    Posts
    2

    Default

    Were having the same issue when trying to compile the adnsf website. Does anyone have any ideas.

  3. #3
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Part of the control that loads the admin menu looks for the presence of a specific .cs file in the /admin/controls folder. If that's not there (which it won't be if you precompile), that error will be shown. You'll have to modify the menu to run precompiled.

  4. #4
    ssgumby is offline Senior Member
    Join Date
    Feb 2009
    Posts
    683

    Default

    Scott, im not sure what you are talking about but my 9.0.1.3 is precompiled and running fine without any .cs files. I just verified that my admin\controls only houses .ascx files

  5. #5
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    PghKid and rkratt007:

    You're getting that error because AdminMaster.Master couldn't load the AdminMenu.ascx file. Have you checked if AdminMenu.ascx really exists in {root}/controls folder? Or, do you have any .ascx stored in the NOTES field from the customer table (e.g. select Notes,* from customer where customerid={customerid})?

    Also, if possible, you can set breakpoint in the Page_Load() method of AdminMaster.master.cs file and step through it to see why you're getting the error.

  6. #6
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    I am having the same issue, where any of you guys able to resolve? and if so what steps did you take.

    Thanks
    MSX

  7. #7
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    "AdminMenu.ascx really exists in {root}/controls folder?"
    This should be admin/controls folder right?
    also checked the notes fields and was all good there.

    placed breakpoint on line 27 of AdminMaster.master.cs
    and VS said that the break point will not be hit.
    Any ideas?

    Thanks
    MSX

  8. #8
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    By the way I am getting this error without precompile.
    MSX

  9. #9
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Rebuild your website. If you have made changes to your source since the last compilation, you will not be able to debug it and that's the reason you're getting the error.

  10. #10
    glennewing is offline Junior Member
    Join Date
    Oct 2005
    Posts
    15

    Default Admin Menu Fix for Precompiled Sites

    I just ran into this problem with MS 9.1. Scott is correct about needing a mod in App_Templates/AdminMaster.master.cs. The simplest, brute force way to make this work in precompiled is to modify the beginning of the Page_Load event handler:
    Code:
               //if (base.ThisCustomer.Notes.Trim().Length > 0 && base.ThisCustomer.Notes.Contains(".ascx"))
                //{
                //    LoadMenu(base.ThisCustomer.Notes, base.ThisCustomer.LocaleSetting, false);
                //}
                //else
                //{
                //    LoadMenu("AdminMenu.ascx", base.ThisCustomer.LocaleSetting, true);
                //}
    
                pnlMenu.Controls.Add(LoadControl("/admin/Controls/AdminMenu.ascx"));
    Adjust the "path to the control" string if you have changed the name of the admin directory.

    If you want to automatically adjust to admin directory name changes and/or use the Customer.Notes trick for giving custom, restricted access to the Admin area then, instead of the above, replace in AdminMaster.master.cs the NewAdmin_App_Templates_AdminMaster.LoadMenu method with:

    Code:
            private void LoadMenu(String ctrlToLoad, String localeSetting, bool isDefaultMenu)
            {
                //Boolean controlExists = true;
                Control adminMenu; 
                String ctrlName = AppLogic.AdminLinkUrl("Controls/" + ctrlToLoad, true);
    
                Literal litError = new Literal();
                litError.Mode = LiteralMode.PassThrough;
                litError.Text = AppLogic.GetString("admin.menu.loaderror", localeSetting);
    
                try
                {
                    try
                    {
                        adminMenu = LoadControl(ctrlName);
                    }
                    catch
                    {
                        adminMenu = litError;
                        SysLog.LogMessage("Control Not Found", "Unable to load menu control {0}.".FormatWith(ctrlToLoad), MessageTypeEnum.GeneralException, MessageSeverityEnum.Error);
                    }
                    pnlMenu.Controls.Add(adminMenu);
                }
                catch (Exception ex)
                {
                    SysLog.LogException(ex, MessageTypeEnum.GeneralException, MessageSeverityEnum.Error);
                }
            }
    This should be essentially the same functionality as the original but work in the precompiled context.