Open secondary pages in a particular Aspnet Core space

Asked

Viewed 42 times

1

I have a page where I use the @renderBody to open my main pages, but the need arose to get a submenu and need the following pages to be opened in a certain space, but when shooting the Asp-controller Asp-action it opens on the site of @renderBody, how can I do to create a kind of @renderBody2 in case a renderPage or renderSection but open through a link click?

  • To solve the case temporarily I have set the layout again on each page, the problem will all be loaded again at each request.

  • renderBody, renderSection are rendered by the server (server-side), and what you want is in the client-side, you may have to resolve this with JS, make the contents of the link be loaded via AJAX in a certain space of the page (by the id of the element for example). Another solution would be to identify that these actions are to be opened in an alternative place, so in your Layout you would identify this and replace the Renderbody (I don’t know if it’s wrong to have more than one Renderbody on the page, or if you can use a conditional Renderbody, just testing)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.