1

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

但是在单击单选按钮列表时,我的两个事件即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 

class="mmovehead">付费</span>

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

0 回答 0