//前台
<asp:button id="butOk" Runat="server" Text="提 交"></asp:button>
//后台
private void butOk_Click(object sender,System.EventArgs e)
{
string insertStr = "Insert into bgsq (class,title,content,sc,subdate,duty) Values ('"
+ Class.Text + "','"
+ title.Text + "','"
+ content.Text + "','"
+ cCustomer.SelectedItem.Value + "','"
+ DateTime.Today + "','"
+ cUserId + "')";
SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["sqlconn"]);
conn.Open();
SqlCommand comm = new SqlCommand(insertStr,conn);
comm.ExecuteNonQuery();
conn.Close();
Response.Redirect("bgsq.aspx?t1="+t1+"&t2="+t2+"&SC="+SC); } private void InitializeComponent()
{    
this.butOk.Click += new System.EventHandler(this.butOk_Click);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion
}
}