2
MVC 4 응용 프로그램을 만들고 있습니다. 나는 PDF 파일 복잡한 모델을 ActionAsPDF에 전달하는 방법은 무엇입니까?
를 생성하는 Rotativa을 사용하고 그들은라는 방법public ActionAsPdf(string action, object routeValues);
내가
즉 routeValues
에 복잡한 객체를 전달 문제가 데 있습니다내가 가지고있는 ViewModel
을public class FullName
{
public string FirstName { get; set; }
public string Surname { get; set; }
}
public ActionResult Index(FullName name)
{
ViewBag.Message = string.Format("Hello {0} to ASP.NET MVC!", name);
return View();
}
public ActionResult Test()
{
var fullname = new FullName();
fullname.FirstName = "John";
fullname.Surname = "Smith";
return new ActionAsPdf("Index", new { name = fullname }) { FileName = "Test.pdf" };
}
내가 걸을 때, Index
조치 이름이 null ... 복잡한 모델을 어떻게 통과합니까?
멋진 덕분에 .. – user2206329
어떻게 내가 ActionAsPdf 두 viewmodels을 통과 할 호출? – user2206329