ASP.NET MVC ViewPage 执行
我(粗略地)跟踪从控制器方法中调用 return View();
后生成视图所采取的步骤。
到目前为止,我已经完成了以下步骤:
- 调用 View()
- 创建 ViewResult,并将来自控制器的 ViewData 传递给它。
- 调用 ViewResult.ExecuteResult()。
- 从这一点我知道 ViewData 然后再次传递到 ViewPage 对象的 ViewContext 属性。
- 奇迹发生了,ViewPage 被发送到输出流。
这里缺少很多步骤,有人知道跟踪执行流程的好资源吗?
干杯!
克里斯
I am (roughly) tracing the steps that are taken to generate a view once you call return View();
from within a controller method.
Thus far I have gotten these steps:
- Call View()
- A ViewResult is created with the ViewData from the Controller being passed to it.
- ViewResult.ExecuteResult() is called.
- From this point I know that the ViewData is then passed once again to the ViewContext property of the ViewPage object.
- Magic happens and the ViewPage is sent to the output stream.
There are a lot of steps missing here, does anybody know of a good resource that traces the execution flow?
Cheers!
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您始终可以下载源代码并逐步执行代码以更好地了解内容正在进行中。
You could always download the source and step through the code to get a better look at what is going on.