I have a company object that has a list of branch objects,
the view of my company (located in the company directory) has a strongly typed representation of the list of branches (located in the branch directory),
each branch in the branch has a delete button that I want to send to the delete action in the branch controller.
the deletion action specified in the company controller is currently being called
(there is a deletion action both in the company and in the branch)
I suppose I understand the reason that he does what it is, but what is the best practice in this situation ....
- if a partial view of the list of branches is in the directory of the company or branch?
- should the delete action be deleted in the company or branch controller?
I would have thought that the list of branches should be in the branch directory and call the branch controller, but how do I get it when a partial view is loaded into the View company information?
Hope that made sense
Thanks,
Mark
<% foreach (var item in Model) { %> <tr> <td> <form action="Edit" method="get"> <input type="submit" value="Edit" id="Submit1" /> <input type="hidden" name="id" value="<%= item.Id %>" /> </form> | <form action="Branch" method="get"> <input type="submit" value="Details" id="Submit2" /> <input type="hidden" name="id" value="<%= item.Id %>" /> </form> | <form action="BranchDelete" method="post"> <input type="submit" value="BranchDelete" id="Submit1" /> <input type="hidden" name="id" value="<%= item.Id %>" /> </form>
asp.net-mvc partial-views
foz1284
source share