MVC web APi不在其他域上工作 [英] MVC web APi is not working on other Domain

查看:69
本文介绍了MVC web APi不在其他域上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了MVC Web API。但是当我在其他Project上调用我的Web-API时它无法工作。我在同一个项目或同一个域中使用时工作。请给出一些解决方案或建议。

感谢先进。

i have created MVC Web API .but its not working when i call my Web-API on other Project .ist working when i used in the same project or in same Domain.please give some solution or suggestion.
thanks in advanced .

推荐答案

Temp data: -Helps to maintain data when you move from one controller to other controller or from one action to other action. In other words when you redirect,"tempdata" helps to maintain data between those redirects. It internally uses session variables.

View data: - Helps to maintain data when you move from controller to view.

View Bag: - It’s a dynamic wrapper around view data. When you use "Viewbag" type casting is not required. It uses the dynamic keyword internally.

Session variables: - By using session variables we can maintain data from any entity to any entity.





因此,根据您的要求, @Temp数据是最佳解决方案。


这篇关于MVC web APi不在其他域上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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