Base solution for your next web application

Activities of "alukaszewski"

Answer

Yes that is exactly what I am trying, it should be simple.

using Abp.Configuration;
var value = SettingManager.GetSettingValue("YOUR_SETTING_NAME");

results in VS build failure due to:

'SettingManager' does not contain a definition for 'GetSettingValue'.

The GetSettingValue is highlighted in the VS editor as that cannot be found as a method/whatever of SettingManager.

I am using Mpa.

If I look at the inbuilt Mpa/Controllers/SettingsController.cs, I get more extension methods when I try var value = SettingManager.

I get .GetSettingValueAsync, .GetSettingValueForApplicationAsync etc.

Are you sure I only need using Abp.Configuration? I can see that the SettingsController.cs has the following;

using System.Threading.Tasks;
using System.Web.Mvc;
using Abp.Configuration.Startup;
using Abp.Web.Mvc.Authorization;
using MyProject.Authorization;
using MyProject.Configuration.Tenants;
using MyProject.Web.Controllers;

Do I need to any of those? I did try some but still I do not have the .GetSettingValue extension method when I try SettingManager.

Thanks,

Andy

It's OK, I've figured out I had to remove the jstree.min.css from the .csproj file. I must have missed that one when I removed all the other .min.css files.

Andy

Answer

Aha! Found what I wanted. It was in the RoutConfig.cs, I changed:

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
            namespaces: new[] { "Callisto.Web.Controllers" }
            );

to:

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional },
            namespaces: new[] { "Callisto.Web.Controllers" }
            );

So many places to find things hidden away!

Andy

Answer

OK, maybe I asked my question incorrectly.

When I access my published site in IIS, how do I have it start with the Login page instead of the default "Home page" page? My Startup.cs is already set with LoginPath = new PathString("/Account/Login").

So, basically, I want the project to start with the Account Controller and not the Home Controller? Does that make sense?

Hi Hikalkan, although the code is good for rendering third level menu items - when you navigate to third level URL the parent and grand parent nav-menu <li> is not marked with class=active, so the menu is collapsed.

Figured it out. I had to republish the site and enable the option to remove extra files. Release version on production server now looking great!

I have removed the mpa/bundles files and also modified the .vbproj file to remove the include entries for the .css files as per the commits in GitHub, but the issue remains. When I publish the Release version I am getting 404 for the "/Bundles/img/sidebar-toggle-light.png", but if I publish the debug version of the project the file url is coming from "/metronic/assets/admin/layout4/img/sidebar-toggle-light.png" and works OK.

Why is the Release version going for the /Bundles folder and not the /metronic folder?

I see that this issue has been resolved in 1.7.0 - how do I know which code or files to replace to fix this issue in 1.6.1.0? Do I need to upgrade all files to 1.7.0 - if so, what about my customisations to PageNames.cs etc.

Andy

Any idea?

OK, so I might be on the right track - but can I actually use the customData parameter to add an id="myid" inside the <li> tag, or is customData simply a way of adding attributes in the menu object and not a means to output something in client facing html code?

I wish to be able to use JavaScript document.getElementById function to find an <li> in the DOM, by id, so that I can re-use my existing JavaScript code to inject a sub-item into the menu when the page has loaded. Here is my working function below;

<script type="text/javascript">
        // Add a Dynamic Menu Item linking back to the parent page and make it active.
        var li = document.getElementById('menu-parent01-child01');
        var dynul = document.createElement('ul');
        var dynli = document.createElement('li');
        dynul.classList.add('sub-menu');
        dynli.setAttribute('id', 'menu-parent01-child01-temp01');
        dynli.classList.add('active');
        dynul.appendChild(dynli);
        li.appendChild(dynul);

        dynli.innerHTML = '<i class=icon-bar-chart></i>MenuName';
    </script>

The function above would add a new menu item to the child01 menu item in the menu code I previously posted. or is there an alternative, more modern/MVC solution to finding the current menu item using the abp.application.navigation classes and then the page view adding in a new menu at runtime?

Thanks for your support.

Showing 31 to 40 of 43 entries