我使用(C#)在后面的代码中填充我的gridview,我有一列称为[SO_Status],该列一开始是空的,我想在单击时将[SO_Status]的值更改为“SO已经发送”按钮发送!
这是我的网格视图的捕获:
选择代码是:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
Int16 email;
if ( e.CommandName == "Select")
{
email = Convert.ToInt16(e.CommandArgument);
em.Text = GridView1.Rows[email].Cells[4].Text;
}
}
public void Send_Click(object sender, EventArgs e)
{
if (FileUploadControl.HasFile)
{
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Host = "smtp.gmail.com";
client.Port = 587;
....
try
{
client.Send(msg);
ClientScript.RegisterClientScriptBlock(this.GetType(), "validation", "alert('Your Email was sent successfully!');", true);
}
catch
{
Response.Write("Sent error");
}
}
}
我使用选择按钮从线路中获取邮件地址并将电子邮件发送到此邮件地址,我想在发送此电子邮件后更改 SO_Status,以避免再次向同一个人发送电子邮件。