In the following ASP.NET MVC Core app how do I get the value of selected Tag Helper Radio Button. When Form is posted the propertySelectedOrderType of viewModel is always capturing the value 1 no matter which radio button is selected. It should only hold the value 1 if In-Store Radio button is selected, and should capture value 2 if Online radio button is selected:
@model TestProj.Models.TestViewModel<form asp-controller="TestContrl" asp-action="TestAction" method="post"><div asp-validation-summary="All" class="text-danger"></div><div class="radio"><label><input asp-for="SelectedOrderType" type="radio" value="1" checked="checked">In-Store</label></div><div class="radio"><label><input asp-for="SelectedOrderType" type="radio" value="2">Online</label></div><div> .... ....<button type="button" class="btn btn-info btn-xs">Submit Order</button></div></form>
TestViewModel:
public class TestViewModel { public string SelectedOrderType { get; set; } public string CustormerName{ get; set; } }