0

I have the following code but it doesn't seem to redirect to my action with the given parameter. I have redirected something similar but the parameters were query string parameters. I'm wondering if it is done another way for parameters since the following doesn't work or what I might be doing wrong in my call to the action?

public ActionResult PassThrough (long i)
{
   return RedirectToAction("RedirectAction", new { d = i});
}

public ActionResult RedirectAction (long d)
{
   return SomeView();
}
1
  • What exactly does not work? Does the client not get redirected to the other action or does the parameter you pass not get sent in to the action? If it is the latter, does it work on its own anyway? Commented Aug 17, 2009 at 21:33

1 Answer 1

3

You need to return the redirection command as result:

public ActionResult PassThrough (long i)
{
    return RedirectToAction("RedirectAction", new { d = i});
}
Sign up to request clarification or add additional context in comments.

3 Comments

Haha... didn't we just have this question?
@womp: Dunno, I just came out of the bath.
sorry, i forgot to add the return but it is there. i did a search and didn't find the question you were talking about. can you give me a link?

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.