一段小代码(弹出确认对话框)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "return confirm('真的执行吗?')");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("代码执行成功!");
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "return confirm('真的执行吗?')");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write("代码执行成功!");
}
}