内容发布更新时间 : 2024/12/22 18:31:43星期一 下面是文章的全部内容请认真阅读。
AutoPostBack=\ OnSelectedIndexChanged=\
2.后台关键代码
protected void Button1_Click(object sender, EventArgs e) {
if (Page.IsValid) {
string Message = \;
Message += \账户:\+TextBox1.Text+\+\;
Message += \性别:\ + RadioButtonList1.Text + \ + \;
Message += \出生日期:\ + DropDownList3.Text + \年\ + DropDownList4.Text + \月\ + \ + \;
Message += \地址:\ + DropDownList1.Text + DropDownList2.Text + \ + \;
Message += \:\ + TextBox2.Text + \ + \; Message += \恭喜你,注册成功!\+\+\请保存好你的密码\; Label1.Text = Message;
} else {
Label1.Text = \注册失败,很遗憾\; } }
protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e) {
if (DropDownList1.SelectedValue == \北京\) {
DropDownList2.Items.Clear(); DropDownList2.Items.Add(\东城区\); DropDownList2.Items.Add(\西城区\); DropDownList2.Items.Add(\崇文区\); DropDownList2.Items.Add(\玄武区\); DropDownList2.Items.Add(\海淀区\); }
else if (DropDownList1.SelectedValue == \上海\) {
DropDownList2.Items.Clear(); DropDownList2.Items.Add(\黄埔区\); DropDownList2.Items.Add(\徐汇区\); DropDownList2.Items.Add(\虹口区\); DropDownList2.Items.Add(\静安区\); }
}
3.测试结果
三、主页(及评论)界面 1、前台关键代码
表格、链接、image、audio、DropDownList、RadioButtonList
|
|