怪事!读不到TextBox控件修改后的内容……
我有一个页面,是用来修改之前录入数据的,但奇怪的是:当提交修改后,不能读取TextBox控件修改后的内容,依然是修改前的内容。请大家帮忙看看是什么原因……代码如下:
protected void Page_Load(object sender, EventArgs e)
{
GongChengFuKuan r = GongChengFuKuan.GetResume_FuKuanDengJi(int.Parse(Session["ShiGongHeTongFuKuanDengJiGuanLi_FuKuanDengJiID"].ToString()));
TextBox1.Text = r.XuHao;
TextBox2.Text = r.FuKuanShiJian;
TextBox3.Text = r.JiLuZhuangTai;
DropDownList1.SelectedValue = r.FuKuanFangShi;
TextBox4.Text = r.FuKuanJinE;
DropDownList2.SelectedValue = r.BiZhong;
TextBox5.Text = r.HuiLu;
TextBox6.Text = r.ZheSuanJinE;
TextBox7.Text = r.ShouKuanDanWei;
TextBox8.Text = r.KaiHuYinHang;
TextBox9.Text = r.YinHangZhangHao;
TextBox10.Text = r.JieSuanFangShi;
DropDownList3.SelectedValue = r.PiaoJuLeiXing;
TextBox11.Text = r.JingBanRen;
TextBox12.Text = r.JieSuanDanHao;
TextBox13.Text = r.PiaoJuHao;
TextBox14.Text = r.JingBanShiJian;
TextBox15.Text = r.BeiZhu;
}
protected void Button1_Click(object sender, EventArgs e)//提交修改
{
GongChengFuKuan FuKuanDengJi = new GongChengFuKuan();
FuKuanDengJi.XuHao = TextBox1.Text.ToString().Trim();
FuKuanDengJi.FuKuanShiJian = TextBox2.Text.ToString().Trim();
FuKuanDengJi.JiLuZhuangTai = TextBox3.Text.ToString().Trim();
FuKuanDengJi.FuKuanFangShi = DropDownList1.SelectedValue;
FuKuanDengJi.FuKuanJinE = TextBox4.Text.ToString().Trim();
FuKuanDengJi.BiZhong = DropDownList2.SelectedValue;
FuKuanDengJi.HuiLu = TextBox5.Text.ToString().Trim();
FuKuanDengJi.ZheSuanJinE = TextBox6.Text.ToString().Trim();
FuKuanDengJi.ShouKuanDanWei = TextBox7.Text.Trim().ToString();
FuKuanDengJi.KaiHuYinHang = TextBox8.Text.ToString().Trim();
FuKuanDengJi.YinHangZhangHao = TextBox9.Text.ToString().Trim();
FuKuanDengJi.JieSuanFangShi = TextBox10.Text.ToString().Trim();
FuKuanDengJi.PiaoJuLeiXing = DropDownList3.SelectedValue;
FuKuanDengJi.JingBanRen = TextBox11.Text.ToString().Trim();
FuKuanDengJi.JieSuanDanHao = TextBox12.Text.ToString().Trim();
FuKuanDengJi.PiaoJuHao = TextBox13.Text.ToString().Trim();
FuKuanDengJi.JingBanShiJian = TextBox14.Text.ToString().Trim();
FuKuanDengJi.BeiZhu = TextBox15.Text.ToString().Trim();
GongChengFuKuan.UpdateFuKuanDengJi(FuKuanDengJi);
//关闭子窗口并返回父窗口并模拟单击父窗口的Button13按扭引发其click事件,实现子窗口提交数据后即时异步刷新父窗口中的GridView控件
Page.ClientScript.RegisterStartupScript(this.GetType(), "Test1", "<script>close();opener.document.all('Button13').click();</script>");
}
protected void Button2_Click(object sender, EventArgs e)//取消
{
Response.Write("<script>close()</script>");
}