コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();

        if (IsPostBack)
        {
        }
        else
        {
            int i = 0;
            for (i = int.Parse(DateTime.Now.Year.ToString()) - 100; i <= int.Parse(DateTime.Now.Year.ToString()); i++)
            {
                this.ddlBirthday.Items.Add(i.ToString());
            }
            TextBox_Birthday.Text = "1月1日";

            dt = conns.Citylist();
            ddlcity.DataSource    = dt;
            ddlcity.DataTextField = "Counties";
            ddlcity.DataBind();
            dt = new DataTable();
            string Counties = ddlcity.SelectedItem.Text;
            dt = conns.Arealist(Counties);
            ddlarea.DataSource    = dt;
            ddlarea.DataTextField = "Area";
            ddlarea.DataBind();
        }
    }