0

I'm wonder how can I build full path to the action within my signalR hub. I have code in my hub:

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;
 }

What I want is just to return full url (like example.com/Conteroller/Action?identifier=some_code) to the action.

And here Download action

 public ActionResult Download(string identifier)
 {
       //return download
 }

But I'm getting error.

Response is not available in this context.

dantey89
  • 2,167
  • 24
  • 37

1 Answers1

0

Since your SignalR service is self hosted by owin (isn't it?), you shall try to check this and this answers.

Community
  • 1
  • 1
Igor Lizunov
  • 539
  • 5
  • 12