选择下拉列表时更改多视图活动索引

时间:2013-07-23 08:24:40

标签: asp.net drop-down-menu multiview

  

我做了 AutoPostBack =“true”然后它正在工作......但它去了   页面加载并没有发生我想要的东西..

     

我该如何解决这个问题?

<asp:DropDownList ID="cmbSav_TransferType" runat="server" OnSelectedIndexChanged="cmbSav_TransferType_SelectedIndexChanged">
                                    <asp:ListItem>---Select---</asp:ListItem>
                                    <asp:ListItem>Own Account</asp:ListItem>
                                    <asp:ListItem>Third Party</asp:ListItem>
                                </asp:DropDownList>

背后的代码

protected void cmbSav_TransferType_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (cmbSav_TransferType.SelectedValue == "Own Account") 
        {
            multiview_AccountTransfer.ActiveViewIndex = 0;
        }

        if (cmbSav_TransferType.SelectedValue == "Third Party")
        {
            multiview_AccountTransfer.ActiveViewIndex = 1;
        }
    }

0 个答案:

没有答案