On my ASP.NET MVC site, part of the function allows the user to enter the hours when a certain place is open.
I decided to store this watch in the VenueHours table in my database with the ratio of FK-to-PK to the Venues table, as well as the DayOfWeek, OpeningTime and ClosingTime parameters.
In my view, I want to allow the user to enter only the data that they know about; in other words, some days cannot be filled for the venue. I am going to create checkboxes that the user can check to include the InitTime and ClosingTime fields for DayOfWeek to which the checkbox belongs.
My question is how to pass this information to the HttpPost Controller Action .
Since I know the maximum number of days that can be passed to (7), I could, of course, just write VenueHour zero parameters in my Action 7, but I'm sure the best way.
Can I somehow relate the View information in a list that is passed to my Action ? It will also help me if I come across a scenario where there is no limit to how much information a user can fill out.
source
share