Thursday, 8 December 2016

ASP.NET MVC C# - Redirect to External Website from Controller Action Method

Refer the below code snippet for redirection from ASP.NET MVC Controller to an external website.
The MVC Controller method "Redirect()", is used for redirection from MVC Controller.

public ActionResult Index()
{
    return Redirect("http://www.google.com");
}

Redirect() method can be used for redirecting to an internal url as well.
Find the sample code below:
public ActionResult Index()
{
    return Redirect("/Customer/List");
}

2 comments:

  1. Call McAfee Support phone number 1-855-966-3855, We are third party service provider for a McAfee Customer Service and McAfee Customer Support and not in any way associated with McAfee or any of its partner companies. We offer McAfee Technical Support for McAfee products and sell subscription based additional warranty on computer and other peripheral devices. Our number is toll free within USA and Canada but our services are paid, if you opt for them.

    We not only fix McAfee related issues, but also other antivirus issues. If you need help with your antivirus. Please call our McAfee Phone Number support line at Toll Free 1-855-966-3855. Thank you for choosing our support

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete