Hi
I use below code for sending email:
private string PopulateBodyLink(string userName, string title, string description)
{
string body = string.Empty;
using (StreamReader reader = new StreamReader(Server.MapPath("~/EmailTemplate.htm")))
{
body = reader.ReadToEnd();
}
body = body.Replace("{UserName}", userName);
body = body.Replace("{Title}", title);
body = body.Replace("{Description}", description);
return body;
}
public void SendEmailLink()
{
string body = this.PopulateBodyLink(LblUsername.Text, GetGridview(GridView2), "شماره پیگیری" + Lblrefid1.Text.ToString());
this.SendHtmlFormattedEmail(LblEmail.Text, "شماره پیگیری", body);
}
public string GetGridview(GridView gridView)
{
string sr = "";
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
gridView.RenderControl(hw);
sr = sw.ToString();
}
}
return sr.ToString();
}
as you see here I send gridview for Title:
string body = this.PopulateBodyLink(LblUsername.Text, GetGridview(GridView2), "شماره پیگیری" + Lblrefid1.Text.ToString());
I want send 2 gridview for title but I don't know how I can change below code:
GetGridview(GridView2)
I change it like
GetGridview(GridView2,GridView1)
but it show error
Best regards
neda