Answer the question
In order to leave comments, you need to log in
How to add Partial View to main page?
I have a main page where I want to add Partial Views to the main page by clicking a button. How can I implement this better (C#, ASP.NET MVC)? Everyone
Answer the question
In order to leave comments, you need to log in
Partial Views (and Razor tools in general) are server-side rendering, there are no button clicks to speak of. There are generally two solutions here:
display: none
, and change style on click (JS or :checked
CSS )Once again, the question is, you have a PartialView, and you want to add something like this to the * .cshtml page:
Right?
But if this partial is added to several pages, then you are too lazy to type with your hands every time, do you want "one button"?
If ctrl+c, ctrl+v doesn't suit you, you can look towards the resharper. It has configurable hotkeys for custom pieces of code (you can preconfigure switches or something like that)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question