How can I pass a value in ViewBag to controller via HTML.BeginForm()
?
@using (Html.BeginForm("SaveServiceItemCategory", "Admin",
FormMethod.Post, new { Sku = @ViewBag.SkuCategory }))
{
<span>Service Item Sku : @ViewBag.SkuCategory</span>
}
Controller
public ActionResult SaveServiceItemCategory(FormCollection formCollection,
string Sku)
{}
I am getting Sku as null, and not the value in ViewBag.
How can this be solved?