Skip to content

Is it possible to put a middleware between rendering partial view? #2267

Open

Description

@NguyeNgocPhus

image
I want to put a middleware before rendering this partial view. is this possible?

Activity

  1. changed the title [-]is it possible to put a middleware between rendering partial view?[/-] [+]Is it possible to put a middleware between rendering partial view?[/+] on Jun 2, 2023
  2. muratcakir commented on Jun 2, 2023

    @muratcakir
    Contributor

    What do you mean by middleware? I assume you mean some HTML snippet, another partial or view component, right? If so, you need to declare a widget zone where you can inject content into:

    <zone name="my_zone_name" />

    You can inject content by using IWidgetProvider from anywhere you like (it is a scoped dependency):

    _widgetProvider.RegisterWidget("my_zone_name", new ComponentWidget(...));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions