如何发送特定于gridview的邮件行 [英] How to send mail specific gridview rows
本文介绍了如何发送特定于gridview的邮件行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含3列ID,NAME,STATUS列的GridView
当状态为是时,我想发送该特定行的邮件。知道如何选择/过滤状态为yes的行并在邮件中发送这些行?请帮忙。
任何想法都非常感谢。
我尝试过的:
不确定如何根据状态过滤gridview并在邮件中发送这些行
I have a GridView with 3 columns ID, NAME, STATUS columns
When the status is yes, I want to send mail of that specific row. Any idea how can I select/filter rows which have status yes and send those rows in mail? Please help.
Any ideas are highly appreciated.
What I have tried:
Not sure how to filter gridview as per status and send those rows in mail
推荐答案
在按钮的onclick事件中,循环浏览gridview。找到绑定为是/否的控件,在IF语句中使用此控件,
In your button's onclick event, loop through the gridview. Find the control binded with Yes/No, use this control in an IF statement,
foreach(GridViewRow gvRow in Gridview1.Rows)
{
Label Label1 = (Label)gvRow.FindControl("Label1");
if (Label1.Text =="YES")
{
//send email
}
}
这篇关于如何发送特定于gridview的邮件行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文