Display value correctly in Razor View after Model Binding
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
Hello,
I have 2 action methods **'IncreaseStock'** in my **'StockController'**.

I send the **'StockViewModel**' to View.

The view has a post form.

When I post this form back to the server, I need to display **'storeItem.Quantity'** back to the view.

The **POST 'IncreaseStock'** currently returns an empty view.

My run for the application, even when the **GET 'IncreaseStock'** passes a view model to the view.

After posting the form, the **'storeItem.Quantity'** should be displayed in the same view. The user should be able to select values
for **SelectedStore'** and **'SelectedItem** again and hit the **'IncreaseStock'** button, and the **'storeItem.Quantity'** should be displayed again and so on.
Thanks.
Contributor guide
Research direction
The issue shows GET and POST IncreaseStock actions in StockController, a StockViewModel, and a Razor view, but names no repository files or tests. Start by reviewing the POST action and view described in the issue; done means the view displays storeItem.Quantity after posting and permits repeated selections and submissions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100