Question: I have simple controller:

```
public class TestController : Controller
    {
        public ActionResult Test(string r)
        {
            return View();
        }

    }

```

I have simple View Test.cshtml:

```
<h2>@ViewContext.RouteData.Values["r"]</h2>
        @using (Html.BeginForm("Test", "Test"))
        {
            <input type="text" name="r" />
            <button>Submit</button>
        }

```

I have route rule in Global.asax:

```
routes.MapRoute(
            null,
            "Test/{r}",
            new { action = "Test", controller = "Test",
                r = UrlParameter.Optional }
        );

```

I want to make such thing: user types route value in input, press submit and controller redirects him to page Test/value. But controller show just page with name Test everytime. ViewContext.RouteData.Values["r"] is empty too. I check in debug, Test action recieves user value of r correctly.
How can I realize my idea?
Thanks.

Answer: 
I'm super late to the party, but just wanted to post a solution for reference. Let's assume that this form has more than just a strong as it's input. Assuming there are other inputs, we can wrap up the inputs of the form into a class in our model, called `TestModel` whose properties maps to the id's of the form's inputs. 

In our post, we redirect to the get, passing in the route values we need in the URL. Any other data can then be shuttled to the get using a TempData.

```
public class TestController : Controller
    {
        [HttpGet]
        public ActionResult Test(string r) 
        {
            TestModel model = TempData["TestModel"] as TestModel;
            return View(model);
        }

        [HttpPost]
        public ActionResult Test(string r,TestModel model) //some strongly typed class to contain form inputs
        {
            TempData["TestModel"] = model; //pass any other form inputs to the other action
            return RedirectToAction("Test", new{r = r}); //preserve route value
        }

    }

```
As far as you are saying to post the form to `Html.BeginForm("Test", "Test")` you will be always posted back to the same page. 

A solution could be to use an explicit Redirect to the action using 'RedirectToAction' (in view) or you can use javascript to change the form's action:

```
<input type="text" name="r" onchange="this.parent.action = '\/Test\/'+this.value"/>

```