SelectedIndexChanged仅触发一次

SelectedIndexChanged仅触发一次

本文介绍了RadioButtonList SelectedIndexChanged仅触发一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

RadioButtonList SelectedIndexChanged仅在第一次触发&不是下一次.我无法理解为什么会发生这种情况.请帮助我.
下面是使用的代码.

RadioButtonList SelectedIndexChanged is firing only for the first time & not next time.I am unable to understand why it is happening.Plz help me.
Below is the code used.

 protected void Page_Load(object sender, EventArgs e)
{
   if (!IsPostBack)
    {
       if (isAlive)
       {
        rbllive.SelectedIndex = 0;
       }
       else
       {
       rbllive.SelectedIndex = 1;
       }
   }
}

protected void rbllive_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (rbllive.SelectedIndex == 1)
            {
                pnllive.Visible = true;

            }
            else
            {
                pnllive.Visible = false;

            }
        }



针对更多可读的代码块进行了编辑-losmac [/edit]



[edit]Edited for more readible code block - losmac[/edit]

推荐答案



这篇关于RadioButtonList SelectedIndexChanged仅触发一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 17:03