ASP------ActioinResult之多种返回值

转载:

http://www.cnblogs.com/jiagoushi/archive/2013/01/24/2875454.html
http://www.cnblogs.com/lvcha/archive/2010/05/08/1730490.html

例子:

JavaScriptResult的使用方法

html(../Home/Index.cshtml)

<body>
<button class="Btn">按钮</button>
</body>

js

$(document).ready(function () {
$(".Btn").click(function () {
$.ajax({
type: "POST",
url: "../Home/Index",
data: {},
contentType: "application/x-javascript;charset=UTF-8",
dataType: "script",
success: function () { },
error: function () {
alert("出错了");
}
});
});
});

HomeController

public JavaScriptResult Index()
{
  return JavaScript("alert('dsdsds')");
}
上一篇:Emoji选项列表


下一篇:[入门向选讲] 插头DP:从零概念到入门 (例题:HDU1693 COGS1283 BZOJ2310 BZOJ2331)