1 つのラジオ ボタン リストと 1 つのドロップダウン リストがあり、2 つのイベントrbTypeOfUser_SelectedIndexChanged
とddlCountry_SelectedIndexChanged
. autoPostBack
これらの両方のコントロールを true に設定 しました。
rbTypeOfUser_SelectedIndexChanged
しかし、ラジオボタン リストをクリックすると、との両方のイベントddlCountry_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"><span class="mmovehead">Free</span></span></asp:ListItem>
<asp:ListItem Value="Paid"><span class="mmovehead"><span
class="mmovehead">有料</span>
<asp:DropDownList ID="ddlCountry" runat="server" AutoPostBack="True" ValidationGroup="Registration" Width="300px" TabIndex="3" onselectedindexchanged="ddlCountry_SelectedIndexChanged" >
</asp:DropDownList>