在MVC中,两个局部视图如何连接到indexview [英] In MVC how two partial view connect to indexview

查看:58
本文介绍了在MVC中,两个局部视图如何连接到indexview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过使用现有的数据库表,我有两个创建两个部分视图显示在索引视图中,但在第一个局部视图的索引视图中,两个部分视图上的两个字段名称相同,除了一个最后一个颜色已提交但是第二个没有提交按钮。

显示数据并单击index.cshtml第一部分视图的提交按钮刷新页面并将这些数据显示在index.cshtml的第二部分视图中





请帮助我如何创建两个部分视图,这两个部分视图连接到index.cshtml我是新的这个领域。

by using existing database tables i have two create two partail view those display in to index view but in the index view of first partial view both the feild names are same on both the partial voews except one last coloumn have submit buttom second one dont have the submit button.
display the data and click the submit button of first partailview of index.cshtml refresh the page and display those data in to the second partail view of index.cshtml


please help me how can i create two partail views those two partial views connect to index.cshtml i am new this feild.

推荐答案

你好朋友





不要沮丧,首先用于连接数据库和相关操作





您可以选择在库下使用



(1)ADO.NET库

以下示例可能对您有用。

使用Ado.net插入MVC MVC教程 [插入]



使用此标准文档进行学习目的

ADO.NET [ ADO.NET文档]

(2)实体框架

这里我附上了我的实体框架CRUD操作代码的链接

点击这里后选择MVC练习选项





实体框架你有三个选项选择其中一个方法< br $> b $ b ie。

(1)数据库优先

(2)代码优先

(3)模型第一



请pr为部分视图问题提出代码
Hello friend


Don't be frustrate , First of all for connecting database and related operation


you have option to use below library

(1) ADO.NET library
below example might useful to you .
Insertion in MVC using Ado.net | MVC Tutorials[Insert]

Use this standard documentation for learning purpose
ADO.NET[ADO.NET Doc]
(2) Entity Framework
Here i attached link of my code for CRUD operation with Entity Framework
Choose MVC practice option after clicking Here


for entity framework you have three option choose one of them approach
i.e..
(1) Database first
(2) Code first
(3) Model first

Please provide your code for partial view issue


这篇关于在MVC中,两个局部视图如何连接到indexview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆