同一页面不同函数间怎么传递值啊?
我想实现
private string action;
protected void But_add_Click(object sender, EventArgs e)
{
Panel_add.Visible = true;
txt_timu.Focus();
action = "add";
}
protected void But_ok_Click(object sender, EventArgs e)
{
if (action == "add")
{
string str_add = "insert into zhuti (zhuti,neirong)values('" + txt_timu.Text.Replace("'", "_") + "','" + txt_neirong.Text.Replace("'", "_") + "')";
co_shiti.ENQ(str_add);
Response.Write("<script defer>alert('添加成功!');</script>");
}
dgbind();
txt_timu.Text = "";
txt_neirong.Text = "";
Panel_add.Visible = false;
}
我这样写action为空,大家指点一下