阿普塔纳工作室 3 + Visual Studio MVC 3 = 不能一起工作

发布于 2024-12-21 03:18:57 字数 682 浏览 2 评论 0原文

我正在开发一个 Web 应用程序,其中后端是在 MVC 3 中构建的。当我在 Visual Studio 2010 中运行我的项目时,该应用程序将对 IIS 进行 jQuery Ajax 调用以获取数据,然后将数据显示在浏览器中/前端。然而,我更喜欢在 Aptana Studio 3 中编写 HTML/CSS/JavaScript,并且认为我可以从 Aptana 中的项目调用我的 MVC 控制器。 在 Visual Studio 中,我必须输入“Users/ListUsers”作为 Ajax 调用的 url,但是,当我尝试在 Aptana 中使用“http://localhost:51845/Users/ListUsers”调用相同的 url 时,发出ajax请求但没有返回数据,这似乎与同源策略有关。 是否可以使 Aptana 与 IIS/MVC 控制器正确通信,还是我必须在 Visual Studio 中完成所有工作?

到目前为止我做了什么来解决这个问题?

1)使用WFetch检查“http://localhost:51845/Users/ListUsers”返回的内容,显示返回的Json对象。

2)摆弄Aptana>项目>>属性>预览设置。

3)摆弄Aptana>运行>运行配置。

4)搜索Aptana支持、stackoverflow和Google。

感谢您的任何帮助或将我抛向正确的方向!

I'm working on a web application, where the backend is built in MVC 3. When I run my project in Visual Studio 2010, the app is making jQuery Ajax calls to the IIS to get the data, which is then displayed in the browser/frontend. However, I prefer to use writing HTML/CSS/JavaScript in Aptana Studio 3, and thought that I could call my MVC controller from my project in Aptana.
In Visual Studio, I have to type "Users/ListUsers" as the url for the Ajax call, however, when I try to call the same url by using "http://localhost:51845/Users/ListUsers" in Aptana, the Ajax request is made but there is no data returned, which seem to have something to do with the same origin policy.
Is it possible to make Aptana communicate properly with IIS/ MVC controller or do I have to do all the work in Visual Studio?

What did I do to solve the problem so far?

1) Checked what "http://localhost:51845/Users/ListUsers" returns by using WFetch, which shows the Json Object returned.

2) Fiddled with Aptana > Project > Properties > Preview Settings.

3) Fiddled with Aptana > Run > Run Configurations.

4) Searched Aptana support, stackoverflow and Google.

Thanks for any help or tossing me into the right direction!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文