Skip to main content

Posts

Showing posts with the label how to get values from formcollection in asp.net mvc 4

How to get values from formcollection in asp.net mvc 4?

Hello everyone, I am going share the code sample to get values from formcollection in mvc 4  and all the detail as given below. Update Devices Controller code for update Devices using FormCollection . // POST: /Devices/Edit/id [ HttpPost ] public ActionResult Edit( long id, FormCollection collection) {     try     {         Devices deviceItem = new Devices ();         DeviceRepository RepoDevice = new DeviceRepository ();         deviceItem.OrderID = id;         deviceItem.CustomerID = Convert .ToInt64(collection[ "CustomerID" ]);         deviceItem.Customer = collection[ "Customer" ];         deviceItem.User = collection[ "User" ];         deviceItem.OrderChannel = coll...