I have a simple form with one text box and one submit button. The form basically sends to another page with the value in the text box as a request. When I click the submit button, the request is executed in this format, for example:
mysite.com/?TargetCode=Test1
I would like it to display in this format: mysite.com/Test1
I already have an action in mine HomeControllerthat accepts "TargetCode" as the query string, and I already configured routing in Global.ascx.csfor this. What needs to be done to rewrite the request so that it does not display this URL? TargetCode = in URL? Here is the code for the form:
<% using (Html.BeginForm("Index", "Home", FormMethod.Get, new { id = "CodeForm" }))
Thanks, Kenny.
source
share