<ASP:TemplateField HeaderText="委托选择">
<ItemTemplate>
<input name="MyRadioButton" type="radio" value='<%# Eval("BookIdentityNum") %>' />
</ItemTemplate>
</ASP:TemplateField>string bookIdentityNum = Request.Form["MyRadioButton"].Trim();
当页面第一次加载的时候radiobutton一个也没被选中,这个时候如果提交就会出问题,那么怎样才能在提交前判断是否有选择
,没有选择就alert用户呢
<ItemTemplate>
<input name="MyRadioButton" type="radio" value='<%# Eval("BookIdentityNum") %>' />
</ItemTemplate>
</ASP:TemplateField>string bookIdentityNum = Request.Form["MyRadioButton"].Trim();
当页面第一次加载的时候radiobutton一个也没被选中,这个时候如果提交就会出问题,那么怎样才能在提交前判断是否有选择
,没有选择就alert用户呢
<input name="MyRadioButton" type="radio" value=' <%# Eval("BookIdentityNum") %>' />
if(Request.Form["MyRadioButton"] != null)
string str=Request.Form["MyRadioButton"].ToString(); Request.Form.Get("MyRadioButton"));
Request.Form.Get("MyRadioButton")); 是做什么用的,既然已经定义了个str,为什么还要get一次