I have images inside my Content folder and I want to send the path of them from a SignalR Hub to javascript function so the client can place it in an img src attribute and have it displayed. A signalR hub however doesn't have the Server object to get the web path to send. This is being done after the page has already been loaded. How can I get signalR to find the web path of the image?
1 Answer
You can access Server in your hub from the Context like this:
Context.Request.GetHttpContext().Server.MapPath("Content");
1 Comment
user441521
You did answer the question, it was just the wrong question I was asking I guess. I was looking for a way to get the url of images to pass to the client for them to get.