我想在同一页面中获取2个视图.在我的HomeController中,我得到了我的数据库的信息.但是当我想在我的视图中显示信息时,我遇到了问题.
Homecontroler
public ActionResult DetailEquipe()
{
List<EquipePersonnel> Viewep = new List<EquipePersonnel>();
string path = HttpContext.Request.Url.AbsolutePath;
//string id = path.Substring(path.LastIndexOf("/"));
string id = System.IO.Path.GetFileName(path);
ViewBag.ID = id;
ViewBag.test = "testfail";
List<Equipe> equipe = new List<Equipe>();
List<Personnel> personnel = new List<Personnel>();
try
{
using (var connection = new QC.SqlConnection(
"Server = connection...."
))
{
connection.Open();
Console.WriteLine("Connected successfully.");
using (var command = new QC.SqlCommand())
{
command.Connection = connection;
command.CommandType = DT.CommandType.Text;
command.CommandText = @"Select * from Equipe where Id='" + id + "'"; …Run Code Online (Sandbox Code Playgroud)