c# - Posting results when checkbox is checked in MVC 4 -
I have been asked to reopen this question in more detail.
I am new to MVC and I appreciate any support explanation, although I am in very good net development.
Scenario
I have a calendar that posts the calendar with information, when it is chosen it seems:
@forach (offline calendars in mod. offline calendars. skip (1)) {& lt; Li data-name = "@ OfflineCalendar.Name" data-val = "@ offline calendar." & Gt; @HTMLActionLink (Offline Calendar .Name, "Index", New {ID = Offline Calendar id}, New {@class = "location"}) & lt; / li & gt; } The calendar returns data for only one month, which passes some data through the ContentResult method.
I've added a checkbox for the collected data.
& lt; Label & gt; Archived @html. Checkbox ("CzechArchive") & lt; / Label & gt; My job
I want to add a stored button where a user can view historical data. If this checkbox is checked, then it changes some parameters in the ContentResult data method.
Dilemma
I will easily check whether the checkbox has been checked and fire on an event based on that calendar which has been selected. I am struggling to equal MVC
What I want to do is check whether it has been checked when the calendar has been selected. If it is, then a bool of the right or wrong back. Which will affect ContentResult
I do not want to use Ajax. I just want to check that the checkbox is checked when a location is selected. is that all.
I asked that the related question is here:
Thanks for reading.
It seems that you want to sub-server all this server through your existing code and The value of the checkbox you want to use.
If this is correct, then I will modify ViewModel to include a "Include" boolean and then add it to my page:
@ Html .cackbox (model = & gt; model.IncludeArchived) When you submit your form, the value should be included in your model.
Alternatively, you can check the request. Parsed in the "[Checked Archive"] and Boolean on the server side.
Comments
Post a Comment