我们可以在asp.net mvc 3中一次调用两个actionresult/controller吗? [英] Can we call two actionresult/controller at once in asp.net mvc 3?

查看:52
本文介绍了我们可以在asp.net mvc 3中一次调用两个actionresult/controller吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以一次调用两个均返回部分视图的ActionResult/Controller函数吗?

Can we call Two ActionResult /Controller function at once which both return partial view?

推荐答案

否,您不能使用一个URI同时调用两个操作.这是因为路由表将仅匹配一条路由,然后将执行传递给该控制器和操作.您可以从该操作中调用另一个操作,但是我不建议您这样做,而只是让您的客户端向服务器发送另一个请求,以执行您要运行的另一个操作.

No you can't call two actions at the same time using one URI. This is because the routing table will only match one route and then pass execution to that controller and action. You can call another action from within that action, but I wouldn't recommend it and would just have your client send another request to the server for that other action you want to run.

这篇关于我们可以在asp.net mvc 3中一次调用两个actionresult/controller吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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