Reputation: 3295
How can I fire the oncheckedchanged
event with the following code?
View:
@Html.CheckBoxFor(m => m.Baseline, new { @class = "formCheckbox", tabindex = "24"})
Model:
public bool Baseline { get; set; }
Upvotes: 0
Views: 2033
Reputation: 7705
The oncheckedchanged
event is a webforms event rather than MVC. If you want to capture the change event, you can do that using javascript. Here's an example using jquery:
(function($) {
$('#Baseline').on("change", function(e) {
// do stuff relating to change event here
});
})(jQuery);
Upvotes: 1