RB:
<input type="radio" onclick="accountShow()" runat="server" name="GuestAccount" class="GuestAc开发者_如何学Pythoncount" value="1" />
<input type="radio" onclick="accountShow()" runat="server" name="GuestAccount" class="GuestAccount" value="0" />
Action:
Public Function Edit(ByVal guestAccount As String) As ActionResult
However I am receiving a null value
You should not be declaring server controls there; remove the runat="server"
and I think it should work. Making them ASP.NET server controls means that the actual name/id will be something different, so MVC won't find it.
Generally, you don't use server controls in MVC.
You could use MVC helper methods to render your radiobutton controls in your view which should fix your issue:
<%=Html.RadioButton("GuestAccount", "0", new { @class = "GuestAccount", onclick = "AccountShow()" }) %>
<%=Html.RadioButton("GuestAccount", "1", new { @class = "GuestAccount", onclick = "AccountShow()" }) %>
精彩评论