- ABP Framework version: v8.3.0
- UI Type: Blazor WASM
- Database System: EF Core (PostgreSQL)
- Tiered (for MVC) or Auth Server Separated (for Angular): no
- Exception message and full stack trace:
- Steps to reproduce the issue: Click any toolbar option
The ABP Toolbar is useful but we have a number of actions we want to perform on Logout or navigation to the My Account pages that exist on the host.
I can't find any way to hook into those actions to perform actions before redirection. For Logout I've hooked into the OpenIddict event handlers to cleanup stuff but for the My Account link I can't find any events to hook into so have had to resort to some obvious error messages to alleviate issues users may face when returning to the main application.
Regardless hooking into the OpenIddict events on the Host side requires exposing more services to perform the needed actions, services already available on the client side.
Is there any way to hook into those actions on the client before redirection to the host?
5 Answer(s)
-
0
hi
The toolbar will render as HTML link. So, there is no action hook design.
But you can add some JavaScript to listen to the event if a toolbar link is clicked.
-
0
Ok, I've managed to attach an event handler to the Manage Account button via its Id "MenuItem_Account_Manage", still wary that the redirect will trigger before the new handler has completed but is working for now.
The Logout button however doesn't have an Id or any classes or any other parameters to make it easy to attach event handlers to. Can the next version add an Id to that button please?
-
0
hi
The Logout button however doesn't have an Id or any classes or any other parameters to make it easy to attach event handlers to.
Can you share the HTML code of the whole menu?
I think you can use the CSS selector to query the
Logout
button.Thanks.
-
0
-
0
ok, I will add an
id
to thelogout
element.