Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Razor 使用;返回内容“;在Webmatrix中_Razor_Webmatrix_Asp.net Webpages - Fatal编程技术网

Razor 使用;返回内容“;在Webmatrix中

Razor 使用;返回内容“;在Webmatrix中,razor,webmatrix,asp.net-webpages,Razor,Webmatrix,Asp.net Webpages,有人知道我将如何在WebMatrix ASP.Net网页中编写以下内容吗 return Content(Constants.Gateway.WebhookNotification.Verify(Request.QueryString["bt_challenge"])); 我认为返回内容方法仅由MVC使用?它取决于您想对表达式的结果执行什么操作,但您可以将其呈现给浏览器,如下所示: @Constants.Gateway.WebhookNotification.Verify(Request.Que

有人知道我将如何在WebMatrix ASP.Net网页中编写以下内容吗

return Content(Constants.Gateway.WebhookNotification.Verify(Request.QueryString["bt_challenge"]));

我认为返回内容方法仅由MVC使用?

它取决于您想对表达式的结果执行什么操作,但您可以将其呈现给浏览器,如下所示:

@Constants.Gateway.WebhookNotification.Verify(Request.QueryString["bt_challenge"]))
也可以将其存储在变量中:

var myVar = Constants.Gateway.WebhookNotification.Verify(Request.QueryString["bt_challenge"]));

我已经尝试在浏览器中进行渲染,这正是我想要做的,但我得到的错误是“字符串引用未设置为字符串的实例。参数名称:s”,它看起来像是在您调用的方法中的某个地方引发的错误。也许您的查询字符串值不存在?你应该看看关于网关API的任何文档。是的,API文档是为MVC编写的,所以我一直在尝试重新设计代码,事实证明这很难:p