0

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 1

1

You can access Server in your hub from the Context like this:

 Context.Request.GetHttpContext().Server.MapPath("Content");
Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.