假设我有一个RadioButtonList
控件:
<asp:RadioButtonList ID="rdbSubscriptionType" runat="server">
<asp:ListItem Value="Eval" Selected="True">Evaluation</asp:ListItem>
<asp:ListItem Value="Monthly" Enabled="false">Monthly Subscription (not available yet)</asp:ListItem>
<asp:ListItem Value="Yearly" Enabled="false">Yearly Subscription </asp:ListItem>
</asp:RadioButtonList>
恶意用户确实可以使用POST操作 a ListItem
with提交到服务器Enabled = "false"
。我想禁止这种行为。
在服务器端,我可以简单地检查:
if( rdbSubscriptionType.SelectedItem.Enabled == true)
但我不确定恶意用户是否也可以使用Javascript或类似技术从客户端更改控件的启用状态。是否有执行此验证的最佳实践?