ASP.NET - Associate controller to empty partial view

Asked

Viewed 16 times

0

I have an empty partial Razor view that does not depend on any entity in my class model. I intend to place two drodpowns with a button for each one that allows adding records. For this, I will need a controller. How do I associate a controller with an empty partial Razor view that is not associated with any class?

  • If I understand what you meant, the view doesn’t have to be related to the controller, just be called by it.. usually when the view has a model, you send "Return View(model)" in which case it would be "Return view()"

  • As @M.Bertolazo commented, you don’t need to associate the view with the controller, and usually a view without a model, which I think is what you mean by "it doesn’t depend on any entity," it’s usually something like a static device for example, that needs to be run by a controller, may simply be included in another view

  • I get it. Thank you!

No answers

Browser other questions tagged

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