【发布时间】:2016-12-19 22:12:49
【问题描述】:
我想知道如何在我的 signalR 集线器中构建完整的操作路径。我的中心有代码:
public string GetUpdateUrl(string identifier)
{
var helper = new System.Web.Mvc.UrlHelper(HttpContext.Current.Request.RequestContext);
var result = String.Empty;
try
{
result = helper.Action("Download", "Agent", identifier);
}
catch (Exception e)
{
var t = e;
}
return result;
}
我想要的只是将完整的网址(例如 example.com/Conteroller/Action?identifier=some_code)返回给操作。
这里下载操作
public ActionResult Download(string identifier)
{
//return download
}
但我遇到了错误。
在这种情况下没有响应。
【问题讨论】:
-
把它和你的标识符一起传递怎么样?
-
Response is not available in this context.你的代码中没有Response字.. 你错过了什么
标签: c# asp.net asp.net-mvc-4 signalr