How to fire checkbox Click event in asp.Net MVC Razor

I have the "IsQuantityAvailable" checkbox for selection, if the seller has the availability of goods and on the CLICK of this chkBox, I have to show the TextBox to enter the quantity of the goods. Please suggest a solution using MVC Razor ... Thanks!

+3
source share
1 answer

As suggested by Mario, the solution has no particular relevance to the razor, however this may help. Create a checkbox using Html.Checkbox or Html.CheckboxFor if you have strict model binding. Add the onclick eventhandler checkbox to the checkbox when adding

@Html.Checkbox( "somename", new { @onclick="function-to-open-dialog()"})

"" " , . jquery, $(" # DialogId "). Dialog (" open")

+7

All Articles