Last post Jan 15, 2020 03:34 AM by jiadongm
Jan 14, 2020 02:20 PM|uid829402|LINK
I'm building out a view page and using an existing controller, so I just created the view. Now, I want to break it out so the view has it's own controller, is there a way to add a controller to an existing view?
Jan 14, 2020 02:38 PM|DA924|LINK
A view works with an action method in the controller. You can create a controller and make an action method for the view, meaning the view.cshtml file name must match the action method name to tie them together.
Jan 14, 2020 04:50 PM|codemovement.pk|LINK
There is no way like we right click on Action Method of controller and create new view. But if you have form on your view and want to post then to specific controller action then use
@using (Html.BeginForm("Create", "requestsController"))
Jan 15, 2020 03:34 AM|jiadongm|LINK
is there a way to add a controller to an existing view?
One action corresponds to one view. For example, you have a existing view called Index.cshtml, the Action name should be Index, then they can match.