我有一个变量
var result = client.DownloadString(query);
在 mvc 4 rzaor 中。通过在调试过程中悬停它,它喜欢下图
我想要的是显示它,所以我用代码将它返回给 javascript:
function myFunction() {
$('#response').text('@(Url.Action("result"))');
}
编辑:
<div id="response"></div>
@{
var strSearch = "test";
var options = "include-passage-references=true";
var client = new WebClient();
var query = string.Format("http://www.xxx.org/v2/rest/passageQuery?key={0}&passage={1}&options={2}", "IP", Server.UrlEncode(strSearch), options);
var result = client.DownloadString(query);
}
然而什么也没找到。