Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Facing error 'Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException' when input control disabled!

$
0
0

Hi

my problem is that when i disable my input control as follow :

<div class="form-group"><label asp-for="OrderId" class="control-label"></label><input asp-for="OrderId" class="form-control" value="@ViewData["_orderID"]" disabled="disabled" /><span asp-validation-for="OrderId" class="text-danger"></span></div>

I'm facing this error during update :

Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.

But when i remove disable tag from my input element it works correctly!!!

What's the problem & how to solve it ?

Note : The given input field (OrderId) is primary key for my Orders table.

Thanks in advance


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>