下午。

我有一个内,提供了一个线上,每行"反馈"列。

在更新,一个漂亮小小的消息框中说,"谢谢你的反馈,我们将在触摸...等等,等等"

我怎么会去抓住这个编辑行的内,并把这个发给一个电子邮件地址?

任何帮助极大的赞赏一。净新手!

有帮助吗?

解决方案 2

其实,我与工作一种享受以下去

 MailMessage feedbackmail = new MailMessage(
                "joe.bloggs@joebloggsland.co.uk",
                "joe.bloggs@joebloggsland.co.uk",
                "Subject",
                e.NewValues.Values.ToString());

            SmtpClient client = new SmtpClient("SMTP");
            try
            {
                client.Send(feedbackmail);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Email unable to be sent at this time", ex.ToString());
            }

其他提示

我假设你有一个按钮就行,正在被用来生成的命令发送的反馈。你可以设定CommandArgument上的按钮"反馈"然后捕获它在onRowCommand事件。

添加onRowCommand事件在html侧页:

<asp:GridView ID="GridView1" runat="server" OnRowCommand="myCommand">
</asp:GridView>

然后加入事件背后的代码:

protected void myCommand(object sender, GridViewCommandEventArgs e)
{
    if (e.CommandArgument == "feedback")
    {
        // Grab the row being edited, find the cell/control and get the text
    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top