I have this radio button code in my MVC Razor View form and other form data.
<div class="row">
<input type="radio" id="Apply-Self" name="selector">
<label for="Apply-Self">Apply for Myself</label>
<div class="check"></div>
<input type="radio" id="Apply-Others" name="selector">
<label for="Apply-Others">Apply for Others</label>
<div class="check"><div class="inside"></div></div>
</div>
This radio button is not a datatype in my model because I'm using this as a front end option. When I click on submit my controller has all the data I want but want to use the radio button to do a condition check before I submit.
How can I get the radio button id to the controller so that I can do this?
[HttpPost]
public ActionResult ApplyAC(ACModel Model)
{
if (Apply-Self is check)
{
var AddAC = Ac.Add(Model);//add data1 in model
}
else
{
var AddAC = Ac.Add(Model);//add a different data
}
}