http://bbs.csdn.net/topics/390961335

用ViewModel,把内容和评论构造到一个类中

 

这个简单,定义一个模型,包含两个属性,各自为那两个模型的类型,用这个模型。
比如
class MyModel
{
    public TopicModel Topic { get; set; }
    public CommentModel Comment { get; set; }
}



ViewBag.A = 对象1;
ViewBag.B = 对象2;
return View();

相关文章:

  • 2022-12-23
  • 2021-05-18
  • 2022-01-05
  • 2022-12-23
  • 2021-11-12
猜你喜欢
  • 2022-12-23
  • 2021-12-17
  • 2022-01-18
相关资源
相似解决方案