C
C#9mo ago
XD

❔ I get Invalid ModelType because my hidden field is empty

So I have a field (Unit of measurement) that will be hidden if the user chooses the option ''Check-in''. If the user chooses that option and then uploads the form, the field will be shown, followed by the error ''The UnitOfMeasurement field is required". How can I prevent this from happening? I want the UnitOfMeasurement field to be equal to "Done" The cshtml.cs code: https://pastebin.com/vRYqHbCr The cshtml code: https://pastebin.com/QhW9CvRH
Pastebin
public class CreateHabitModel : PageModel { private reado...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
@page@model MVC.HabitTracker.Pages.CreateHabitModel@{}Create a hab ...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
1 Reply
Accord
Accord9mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.