62,046
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(Request["Add"]) && Request["Add"]=="true")
this.Response.Write("<script>alert('Add')</script>");
}
protected void Button1_Click(object sender, EventArgs e)
{
string str=this.TextBox1.Text;
//是否为空 or null
if (string.IsNullOrEmpty(str))
{
}
else
{
//当前页为 Default.aspx
this.Response.Write("<script>if (confirm('已存在是否继续添加?')){window.location.href='Default.aspx?Add=true';} </script>");
}
}
if (dr1.Read())
{
//数据库中已经存在存在同名的数据
}
else
{
Page.RegisterStartupScript(" ", "<script>if (confirm('还没有,要添加吗?')){self.location.href='./Plan_Add.aspx';}</script>");
}