tags:

views:

16

answers:

2

string Emails = ""; foreach (GridViewRow gr in gvregview.Rows) { CheckBox chk = (CheckBox)gr.FindControl("Checked"); Label ID = (Label)gr.FindControl("lblEmail"); Label lbl = (Label)gr.FindControl("lblPass"); Label Lblmrno = (Label)gr.FindControl("Lblmrno"); if (chk.Checked == true) {

                SendMail(ID.Text, lbl.Text);
                //lblmsg.Text = "Mail Sent to "+Lblmrno.Text;
                Response.BufferOutput = true;
                puposalda.MailSentResponse = Lblmrno.Text;
                //Response.Write("Mail to sent to" + Lblmrno.Text);
                System.Threading.Thread.Sleep(500);

            }


        }

Hi Everybody, i want to send mail to all selected users in gridview and display Message 'Mail sent to the user UserName' for each user. Mail is sent successfully but only last user name is displaying. How to do that. Response.write is working but it is displaying message on the top. But i want to display message at specific location.

Thanks Thanks

A: 
lblmsg.Text += "Mail Sent to "+Lblmrno.Text+", ";

in that case you ADD the text, not replace it.

Stefanvds
A: 

I want to replace text not append Text. When mail to the first user has been sent successfully. Then message should display on the page. then same for other users.

Mohan Sharma