请参阅cshtml单选按钮

时间:2016-12-13 20:28:19

标签: c# razor

我在cshtml中创建了以下单选按钮,但我无法运行' if'声明

<form method="post" id="Button">
     <input type="radio" name="HomeBtn" value="Assembly"
         id="AssemblyDrawings" checked/> Assembly Drawings
     <input type="radio" name="HomeBtn" value="Literature"
         id="RelatedLiterature"/>  Related Literature
</form>

以下C#无效

@if(true) {
string things = String.Format("{0}", Request.Form["Button"]); 
  if (things == "Assembly") {
  {
     *do some stuff*
  }
}

0 个答案:

没有答案