C# 在mvc中将模型显示为查询字符串的浏览器
asp.net mvc中存在问题,浏览器将完整模型显示为查询字符串的一部分 我有第一种方法,给出员工名单C# 在mvc中将模型显示为查询字符串的浏览器,c#,asp.net-mvc,c#-4.0,asp.net-mvc-4,C#,Asp.net Mvc,C# 4.0,Asp.net Mvc 4,asp.net mvc中存在问题,浏览器将完整模型显示为查询字符串的一部分 我有第一种方法,给出员工名单 [HttpGet] public ActionResult GetEmployees() { model.employees = GetEmployeeList() return View(model); } [HttpPost] public ActionResult DisplayEmployee(Guid id
[HttpGet]
public ActionResult GetEmployees()
{
model.employees = GetEmployeeList()
return View(model);
}
[HttpPost]
public ActionResult DisplayEmployee(Guid id)
{
model.emp=GetEmployeeDetails(id);
return View("GetEmployees",model);
}
我得到完整的查询字符串,如下所示
StakeWorking=ColloSys.DataLayer.Domain.StkhWorking&StkHolder=ColloSys.DataLayer.Domain.Stakeholders&StkhPaymentP=ColloSys.DataLayer.Domain.StkhPayment&StakeAddress=ColloSys.DataLayer.Domain.GAddress&StakeAddressDetails=ColloSys.UserInterface.Models.StakeAddressDetails&StkhWorkingDetails=ColloSys.UserInterface.Models.StakeWorkingDetails&ListOfRegion=System.Collections.Generic.List%601%5BSystem.String%5D&ListOfProduct=System.Collections.Generic.List%601%5BSystem.String%5D
您可以检查视图中的模型绑定是否正确完成
看看,问题解决了。显示员工行为的post方法中的实际问题 我试过了,问题解决了
[HttpPost]
public ActionResult DisplayEmployee(Guid id)
{
model.emp=GetEmployeeDetails(id);
return View("GetEmployees");
}
你的观点是什么?如果没有视图的代码,就无法说明它为什么输出给定的字符串。您可以共享视图的代码吗?您可以共享视图中表单标记的代码吗?