protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Button1.Attributes.Add("OnClick", "return confirm('是否继续?')");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
this.Label1.Text = "aaaaaaaaaaaaa";
} protected void Button2_Click(object sender, EventArgs e)
{
this.Label1.Text = "";
}
{
if (!Page.IsPostBack)
{
Button1.Attributes.Add("OnClick", "return confirm('是否继续?')");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
this.Label1.Text = "aaaaaaaaaaaaa";
} protected void Button2_Click(object sender, EventArgs e)
{
this.Label1.Text = "";
}
注意大小写
int i=0;
protected void Button1_Click(object sender, EventArgs e)
{
if(i=查询数据库来的值)
{
...confirm('是否继续?');....
this.Label1.Text = "aaaaaaaaaaaaa";
}
}
请问
...confirm('是否继续?');....该如何写呢?
前面的问题解决了,烦看看后面的问题
{
Button1.Attributes.Add("OnClick", "return confirm('是否继续?')");
}
去掉if块 改成Button1.Attributes.Add("onclick", "javascript:return confirm('是否继续?');");