ex4.aspx.cs
来自「这是个通讯录的源代码,里面实现对信息的添加,删除和修改」· CS 代码 · 共 40 行
CS
40 行
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public class ex4 : System.Web.UI.Page {
protected DropDownList kind;
protected TextBox Emailname;
protected TextBox Yourname;
protected TextBox Youraddress;
protected TextBox code;
protected TextBox company;
protected TextBox phone;
protected TextBox age;
protected TextBox people;
protected Button submit;
protected Label message;
// OnLoad handler to populate the dropdownlist
override protected void OnLoad(EventArgs e) {
if (!IsPostBack) {
kind.Items.Add(new ListItem("学校"));
kind.Items.Add(new ListItem("政府部门"));
kind.Items.Add(new ListItem("私营企业"));
kind.Items.Add(new ListItem("国有企业"));
kind.Items.Add(new ListItem("个体经营"));
}
}
// Handler for the button
protected void OnClickHandler(object src, EventArgs e) {
string newMsg = string.Format(
"您好,{0}<br />你注册的邮箱是:{1}@163.com<br />你的个人信息如下:<br /><table border=1><tr><th>家庭地址</th><th>{2}</th></tr><tr><th>地址电话</th><th>{3}</th></tr><tr><th>邮箱密码</th><th>{4}</th></tr><tr><th>工作单位</th><th>{5}</th></tr><tr><th>单位类型</th><th>{6}</th></tr><tr><th>性别</th><th>{7}</th></tr><tr><th>年龄</th><th>{8}</th></tr></table>",Yourname.Text,Emailname.Text,Youraddress.Text,phone.Text,code.Text,company.Text,kind.Text,people.Text,age.Text);
message.Text = newMsg;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?