Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Issues with menu's client side vs server side and staying open. #6427


User avatar
0
AndrewT created

We are using .net core MVC and JQuery.

When clicking on any menu item on the abp vertical menu, the layout page js files get loaded again, in other words a full postback happens everytime the user clicks any menu item. That is slow, and blocks (or actually just loses) incoming SignalR notifications, and resultant alerts driven from signalR dont get displayed.

One of our developers found a solution using partial views which will replace the body content making a ajax call, so the main postback is avoided.

However to achieve this solution we need the abp vertical menu to be generated on the client side .

Has anyone done the abp vertical menu on the client side using MVC and JQuery?. I know it is possible using angular, but we do not want to move to that technology at this time.

Also, say there are 4 main menu items and 5 sub menu items under each of the 4 main menu items.

When we select a sub menu item we also want the menu to stay open with the sub menu item selected still highlighted, and the form related to the menu item to be displayed. At present the menu collapses again each time the sub menu item is selected.

Any help appreciated!


7 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @andrewt

    This is totally a different arhcitecture than AspNet Zero provides. What you need is exactly a SPA :).

  • User Avatar
    0
    AndrewT created

    @ismcadgas

    Yes in hindsight SPA might have been a better architecture, however we have gone down the path of .net Core MVC/Jquery and don't have the luxury of time to change that now... so... the problem persists, we can try and live with the menu issue, and worst case wil code a static menu, but the page re-load and losing SignalR notifications is an issue which we'd like to solve if we can? Andrew.

  • User Avatar
    0
    aaron created
    Support Team

    What's the "page re-load and losing SignalR notifications" issue?

  • User Avatar
    0
    AndrewT created

    If a signalr notification comes in that we wish to say popup a modal dialogue, and the user clicked a menu item and so the whole page is loading again, it misses the notification and so no modal will be displayed. We think we have a workaround, but its not ideal..

  • User Avatar
    0
    aaron created
    Support Team

    That seems reasonable...

  • User Avatar
    0
    AndrewT created

    Any ideas how to fix that as its a major issue to use signalr with the framework if it can lose notifications.

  • User Avatar
    0
    aaron created
    Support Team

    That's how real-time (non-persistent) notifications work.