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.

public class HomeController : Controller
{
public ActionResult Index(string value)
{
return View();
}
}

@using (Html.BeginForm("Index", "Home", FormMethod.Get))
{
string value = "abcde";
@Html.TextBox("value", value)
<input type="text" name="date" value="@value" />
<input type="submit" value="Submit" />
}

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 show 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>