本文介绍了当页面再次回发时,单选按钮未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的网页项目中,我有一个文本框,按钮,两个radiobuttons和一个texbox的requiredfield验证器。通常,radiobutton1被检查为真,或者如果我选择radiobutton2,它将被检查为真。在按钮上单击页面ll postback,之后没有任何radiobutton被检查。我的radiobuttons UI部分以及当我们clcik在跨度时显示radiobutton
In my web project i have a textbox ,button,two radiobuttons and a requiredfield validator for texbox. Normally the radiobutton1 is checked as true or if i select radiobutton2 it will be checked as true. On button click the page ll postback,after that none of the radiobutton is checked.here is my radiobuttons UI part and also the radiobutton is showed when we clcik on the span
<span class="linktr" data-dialog-append="Form1" data-dialog="detailsPop" data-dialog-width="340" data-dialog-y="center+80 center" data-dialog-x="center center" data-modal="false">Edit</span>
<li><strong><asp:RadioButton ID="prRdBtn" runat="server" Text="Private" EnableViewState="True" GroupName="list" CausesValidation="False" /></strong>
Only you .
</li>
<li><strong><asp:RadioButton ID="puRdBtn" runat="server" Text="Public" EnableViewState="True" GroupName="list" CausesValidation="False" /></strong>
Anyone can .
推荐答案
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
prRdBtn.Checked = true;
}
}
这篇关于当页面再次回发时,单选按钮未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!