I have a controller that takes a string. In my view I hardcode the value of the input field, so it should always be the same.<br /><br />public class HomeController : Controller<br />{<br /> public ActionResult Index(string value)<br /> {<br /> return View();<br /> }<br />}<br /><br />@using (Html.BeginForm("Index", "Home", FormMethod.Get))<br />{<br /> string value = "abcde";<br /> @Html.TextBox("value", value)<br /> <input type="text" name="date" value="@value" /><br /> <input type="submit" value="Submit" /><br />}<br /><br />If I change the value in the query string to something like ?value=12345, the @Html.Textbox value changes to the value of the querystring, instead of the value that I provided it. The other input field shows the correct value.
↧