下拉列表和radiobuttonlist选择改变了事件处理

时间:2012-06-07 10:14:08

标签: c# asp.net

我有一个单选按钮列表和一个下拉列表,我处理了两个事件rbTypeOfUser_SelectedIndexChangedddlCountry_SelectedIndexChanged。我为这两个控件设置了autoPostBack为真。

但是点击radiobutton列表后,我处理了rbTypeOfUser_SelectedIndexChangedddlCountry_SelectedIndexChanged两个事件,并且在下拉列表选择更改时未处理ddlCountry_SelectedIndexChanged

可能是什么问题?

protected void rbTypeOfUser_SelectedIndexChanged(object sender, EventArgs e)
    {
        //ViewState["TypeOfUser"] = rbTypeOfUser.SelectedItem.ToString();
        if (rbTypeOfUser.SelectedValue == "Free")
        {
            trmembership.Visible = false;
            //DDLMembershipPlan.Visible = false;
        }
        else
        {
            trmembership.Visible = true;
            //DDLMembershipPlan.Visible = true;
            //Label8.Visible = true;
            MembershipPlan();
        }

    }

protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
    {
        Parameterised_SQL_Dentry pm = new Parameterised_SQL_Dentry(0,   CommonStrings.ConnectionString);

        //Dentry de=new Dentry();
        string strState = "select vcrState,intState_id from exp_mst_state where intCountry_id='" + ddlCountry.SelectedValue + "' order by vcrState ";

        //de.FillCombo(ddlState,strState,"vcrState","intState_id");
        pm.FillCombo(ddlState, strState, "vcrState", "intState_id");
        ddlState.DataBind();
         ddlState.Enabled = true;
        ddlState.Items.Insert(0, new ListItem("Select State", "0"));

    }


<asp:RadioButtonList align="Center"  ID="rbTypeOfUser" runat="server"     RepeatDirection="Horizontal"  Width="350px" AutoPostBack="True"  onselectedindexchanged="rbTypeOfUser_SelectedIndexChanged" CssClass="checkbox_padd" TabIndex="1"  >
<asp:ListItem   Value="Free" Selected="True"><span class="mmovehead">&lt;span class=&quot;mmovehead&quot;&gt;Free&lt;/span&gt;</span></asp:ListItem>
<asp:ListItem  Value="Paid"><span class="mmovehead">&lt;span 

类= “mmovehead” &GT;付费和LT; /跨度&GT;
    

<asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True"   ValidationGroup="Registration" Width="300px" TabIndex="3" onselectedindexchanged="ddlCountry_SelectedIndexChanged"  >
</asp:DropDownList>

0 个答案:

没有答案