将数据从控制器传递到视图 [英] Pass data from controller to view

查看:72
本文介绍了将数据从控制器传递到视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Web服务获取数据,该服务使用存储过程并返回数据表。现在我不知道如何从action方法调用这个web方法以及如何将它返回的数据传递给视图?请解释一下这个概念。我还没有尝试编写代码。

是否有必要将数据库返回的数据与模型绑定,以便将其传递给视图?

I am fetching data using web service which uses stored procedure and returns data table. Now I don't know how to call this web method from action method and How to pass the data it returns to the view? Please explain me the concept. I have not yet tried to write the code.
Is it necessary to bind the data returned from database with the model in order to pass it to the view?

推荐答案

是的你需要将数据绑定到模型并将该模型传递给视图..
Yes You need to bind data to the model and pass that model to the view..


这篇关于将数据从控制器传递到视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆