Abhishek Gahlout
Abhishek Gahlout

Reputation: 3462

Redirect to some other view after fetching information in MVC

What if I want to redirect to some page after getting some information. Actually I need to have a search box. Then I will get the entered information in some action and then want to redirect to any page. How can I achieve this?

Upvotes: 0

Views: 56

Answers (1)

Captain Kenpachi
Captain Kenpachi

Reputation: 7215

In your Action, add the following code:

return RedirectToAction("ActionName",
                        "ControllerName",
                       new {
                           parameter1 = "something", 
                           parameter2 = "something else"
                           });

Upvotes: 1

Related Questions