0

How do I call a url from controller. i.e. this one "http://xxx.ashx?Item=82f829e6&IsReadonly=false". It cannot be from a href link in the view but has to be from the controller. I am using asp.net MVC Core 1.1

2
  • 1
    Use HttpClient :) Commented Jun 5, 2017 at 11:48
  • I have tried that but is not a get or post or ... So I wonder what I should set contenttype to and how to trigger the send? Should I use SendAsync? Commented Jun 5, 2017 at 12:48

1 Answer 1

2

can you try this

public IActionResult YourAction()
{
    return Redirect("http://www.example.com");
}
Sign up to request clarification or add additional context in comments.

3 Comments

Of course! Just me being emptybrained today. Thank you. Works like a dream.
Not sure how to do that but if you tell me, I'll do so.
Done so. I can only upvote to level 3. It won't led me go any higher. Thanks again.

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.