日期:2014-05-18  浏览次数:20502 次

ddl的aotopostback 这段代码有误?
C# code
protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DDLFamilyRelationship1st.Items.Insert(0, new ListItem("-请选择-", "0"));
            DDLFamilyRelationship2nd.Items.Insert(0, new ListItem("-请选择-", "0"));
            DDLFamilyRelationship3th.Items.Insert(0, new ListItem("-请选择-", "0"));
            DDLFamilyRelationship4th.Items.Insert(0, new ListItem("-请选择-", "0"));
            if (DDLSex.Text == "男")
            {
                DDLFamilyRelationship1st.Items.Insert(1, new ListItem("父子", "0"));
                DDLFamilyRelationship1st.Items.Insert(2, new ListItem("母子", "0"));
                DDLFamilyRelationship1st.Items.Insert(3, new ListItem("夫妻", "0"));
                DDLFamilyRelationship1st.Items.Insert(4, new ListItem("兄妹", "0"));
                DDLFamilyRelationship1st.Items.Insert(5, new ListItem("姐弟", "0"));

                DDLFamilyRelationship2nd.Items.Insert(1, new ListItem("父子", "0"));
                DDLFamilyRelationship2nd.Items.Insert(2, new ListItem("母子", "0"));
                DDLFamilyRelationship2nd.Items.Insert(3, new ListItem("夫妻", "0"));
                DDLFamilyRelationship2nd.Items.Insert(4, new ListItem("兄妹", "0"));
                DDLFamilyRelationship2nd.Items.Insert(5, new ListItem("姐弟", "0"));

                DDLFamilyRelationship3th.Items.Insert(1, new ListItem("父子", "0"));
                DDLFamilyRelationship3th.Items.Insert(2, new ListItem("母子", "0"));
                DDLFamilyRelationship3th.Items.Insert(3, new ListItem("夫妻", "0"));
                DDLFamilyRelationship3th.Items.Insert(4, new ListItem("兄妹", "0"));
                DDLFamilyRelationship3th.Items.Insert(5, new ListItem("姐弟", "0"));

                DDLFamilyRelationship4th.Items.Insert(1, new ListItem("父子", "0"));
                DDLFamilyRelationship4th.Items.Insert(2, new ListItem("母子", "0"));
                DDLFamilyRelationship4th.Items.Insert(3, new ListItem("夫妻", "0"));
                DDLFamilyRelationship4th.Items.Insert(4, new ListItem("兄妹", "0"));
                DDLFamilyRelationship4th.Items.Insert(5, new ListItem("姐弟", "0"));
            }
            if (DDLSex.Text == "女")
            {
                DDLFamilyRelationship1st.Items.Insert(1, new ListItem("父女", "0"));
                DDLFamilyRelationship1st.Items.Insert(2, new ListItem("母女", "0"));
                DDLFamilyRelationship1st.Items.Insert(3, new ListItem("夫妻", "0"));
                DDLFamilyRelationship1st.Items.Insert(4, new ListItem("兄妹", "0"));
                DDLFamilyRelationship1st.Items.Insert(5, new ListItem("姐弟", "0"));

                DDLFamilyRelationship2nd.Items.Insert(1, new ListItem("父女", "0"));
                DDLFamilyRelationship2nd.Items.Insert(2, new ListItem("母女", "0"));
                DDLFamilyRelationship2nd.Items.Insert(3, new ListItem("夫妻", "0"));
                DDLFamilyRelationship2nd.Items.Insert(4, new ListItem("兄妹", "0"));
                DDLFamilyRelationship2nd.Items.Insert(5, new ListItem("姐弟", "0"));

                DDLFamilyRelationship3th.Items.Insert(1, new ListItem("父女", "0"));