I'm trying to submit my form to the database, but when I click on confirm button, I get this error:
.
This is my form:
This is my index class:
And here is my ajax code:
(https://i.stack.imgur.com/EA8a9.png)
I've tried many things but I couldn't solve the problem. Can anyone help me?
It would be nicer if you could include your code snippet instead of images. However, based on your scenario and descriptions, it can be said that, it can be fix in either ways,
You could fetch your property value within jquery function and then post to your razor page handeler or your can directly deserialize your form value and post to the page handler.
Let' have a look in practice, how you could able to implement a post request using ajax in razor page:
Demo Model:
Razor.cs file:
Razor.cshtml:
Output:
Note: Please refer to this official document for more details.