我正在尝试显示我在视图中创建的列表,但仍然得到:"传入字典的模型项的类型为'System.Collections.Generic.List 1[System.String]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable1 [Standings.Models.Teams]'."
我的控制器:
public class HomeController : Controller
{
Teams tm = new Teams();
public ActionResult Index()
{
var model = tm.Name.ToList();
model.Add("Manchester United");
model.Add("Chelsea");
model.Add("Manchester City");
model.Add("Arsenal");
model.Add("Liverpool");
model.Add("Tottenham");
return View(model);
}
Run Code Online (Sandbox Code Playgroud)
我的模特:
public class Teams
{
public int Position { get; set; }
public string HomeGround {get; set;}
public string NickName {get; set;}
public int Founded { get; set; }
public List<string> Name = new List<string>(); …Run Code Online (Sandbox Code Playgroud) 嗨,我用按钮覆盖了我的 ImageView,但是当它们彼此靠近时,你无法分辨它是按钮,它只是一个大红色方块。我需要一种快速简便的方法来为我的按钮设置边框/边缘或其他东西,以便您可以看到不同的按钮。