Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: Querystring is overriding values provided in view. [549]

$
0
0
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.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>