ASP.Net MVC JQuery的AJAX调用不返回任何东西 [英] ASP.Net MVC JQuery Ajax Call That Doesn't Return Anything

查看:104
本文介绍了ASP.Net MVC JQuery的AJAX调用不返回任何东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能通过AJAX使从视图调用一个控制器(在我的情况下,使用JQuery),不返回任何东西?我只是设置会话一些变量并没有输出显示。

Is it possible to make a call from a view to a controller via ajax (in my case using JQuery) that doesn't return anything? I'm just setting some variables in session and there is no output to display.

我试着设置在我的控制器失效的方法,但它不会工作。现在我已标记的方法回报JSonResult,我只是返回JSON(),但似乎像一个有点浪费?

I tried setting the method on my controller to void but it won't work. Right now I've marked the method return as JSonResult and I'm simply returning JSon("") but that seems like a bit of a waste?

推荐答案

<一个href="http://msdn.microsoft.com/en-us/library/system.web.mvc.emptyresult.aspx">System.Web.Mvc.EmptyResult

这篇关于ASP.Net MVC JQuery的AJAX调用不返回任何东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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