I am passing the edited value
and retrieving it back but I dont get back the id
value.. how do I get back the value for Id...The id value will actually remain the same..all I need to do is pass it back again...
public ActionResult EditValue(int id)
{
ViewData["id"]=id;
ViewData["Value"]=GetOriginalValue();
return View();
}
[HttpPost]
public ActionResult EditValue(string Value)
{
//How do I get the id value back..it will always be the same
UpdateValue(id,Value);
}
//---VIEW--
<% Html.BeginForm(); %>
<div class="editor-label">
<%= Html.Label("Value")%>
</div>
<div class="editor-field">
<%= Html.TextBox("Value",ViewData["Value"])%>
<%= Html.ValidationMessage("Value")%>
</div>
<p>
<input type="submit" value="Update" />
</p>
<% Html.Hidden("id", ViewData["id"]);%>
<% Html.EndForm(); %>