我在html公式中的问题上有一个单选按钮选项。这就是html的样子。我正在使用MDboostsrap进行设计。
<h4>Whats the type?</h4>
<div class="custom-control custom-radio custom-control-inline">
<input value="verlust" type="radio" class="custom-control-input AnzeigeRadio" id="VerlustanzeigeRadio" name="Anzeige_typ" checked>
<label value="diebsthal" class="custom-control-label" for="VerlustanzeigeRadio">Verlustanzeige</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input AnzeigeRadio" id="DiebstahlanzeigeRadio" name="Anzeige_typ">
<label class="custom-control-label" for="DiebstahlanzeigeRadio">Diebstahlanzeige</label>
</div>
这是当前的控制器操作:
public ActionResult Create( string Anzeige_typ)
{
//Now I just have an "On" Value on the Anzeige_Typ string
}
例如,我想让“ Anzeige_Typ”将ID从选定的单选按钮传递给控制器。在当前的“打开”状态下,我什至不知道选择了哪个。