Assign existing view to a controller

-2

I have a view that is assigned to a controller. Everything was in this controller. Now we have decided to create a controller for our situation here. Only I would not like to create a new view, since one already exists. This view is called Hotel. I created a controller called Hotel and an Action with the same name. I want to assign this Action to this view. I can not put in Action like this: return view (Hotel); because the return of this action is a parameter passed to the Action, which looks like this: return View (_package); If you give an Add view, you will create a new one. Can you do what you like? I'm waiting.

    
asked by anonymous 27.03.2014 / 17:07

1 answer

2

Just put your View in the Shared directory. So all Controllers can call View Hotel as follows:

return View("Hotel", _package);
    
27.03.2014 / 17:19