具有相同模型的动态局部视图 [英] Dynamic partial View with same model
问题描述
情景:
我在停车场申请工作,所以我需要添加用户,他们的汽车详情,我可以为一个单独添加N号车用户
观看次数:
为此,我添加了两个观点
< b> 1)所有者详细信息(主视图)
2)汽车详情(部分视图)
行动:
在我的所有者详细信息视图中我添加了新按钮,如果单击添加新车,我会将汽车详细信息部分视图加载到所有者详细信息视图中,就像我明智地我可以添加更多汽车
所以最后我点击保存我需要返回所有汽车详细信息部分视图模型到我的控制器页面,如CarDetails列表我怎样才能实现这一点。 />
目前它没有将CarDetails列表返回给控制器,请帮我一些示例代码
Scenario:
I am working Under Parking Lot Application, so I need to add User,with their car details, I can add N number of car for a single User
Views:
For that I ve added two views
1) Owner Details(main View)
2)Car Details (Partial View)
Action:
In My Owner Details View i have add New button,if click add new car,I ll load Car Details partial view into Owners Details view,like wise i can add more that on car
so finally while i click save i need to return all the car Details partial view models to my controller page like List of CarDetails how can I achieve this.
currently it is not returning List of CarDetails to contoller,Pls Help me with some sample code
推荐答案
看到:
ASP.NET MVC特殊视图 - 部分视图和布局 [ ^ ]
ASP .NET MVC部分视图 - 初学者教程 [ ^ ]
See this:
ASP.NET MVC Special Views - Partial View and Layout[^]
ASP .NET MVC Partial Views - tutorial for beginners[^]
这篇关于具有相同模型的动态局部视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!