如何设计制表结构的模型和视图组合

编程入门 行业动态 更新时间:2024-10-20 11:50:37
本文介绍了如何设计制表结构的模型和视图组合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个应用程序,其中包含产品结构的引导标签。一个选项卡显示产品信息,其他显示图库和变体,最后一个选项卡是一个表单。 我能够使用MVC创建第一个选项卡的结构但是当我开始时在第二个标签上工作,我卡住了。我有第一个选项卡的视图和模型,在第二个选项卡中,我渲染了另一个与另一个模型相关联的视图。两个模型都来自不同的文件夹结构。 我收到的错误是

Hi, I have an application which contains bootstrap tab like structure for a product. One tab shows product information other shows gallery and variants and the last tab is a form. I am able to create a structure for first tab using MVC but when I started working on second tab, I got stuck. I had a view and model for first tab and in second tab I rendered another view attached with another model. Both models are from different folder structure. I am getting error that

The model item passed into the dictionary is of type 'one', but this dictionary requires a model item of type 'two'.]

我想我还没有正确创建模型和视图结构。 我尝试了什么: 我正在尝试将标签链接到控制器,它将呈现视图和进一步但在引导选项卡结构中所有三个选项卡内容属于同一HTML DOM。所以,我很难将控制器链接放到标签上。

I think I haven't created model and view structure correctly. What I have tried: What I am trying is to make tabs link to controller which will render the view and further but in bootstrap tab structure all three tab content belong to same HTML DOM. So, I am having difficulty in putting controller link to tabs.

推荐答案

我已经包含了 @Html.RenderAction

到标签页。这将向控制器动作发送请求以呈现部分视图。

into tabs. this will send request to controller action to render a partial view.

更多推荐

如何设计制表结构的模型和视图组合

本文发布于:2023-10-16 16:30:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498103.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组合   视图   模型   结构

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!