Mark the checkbox true in html email template on basis check

Mar 17 2017 7:02 AM

MY HTML TEMPLATE:

<input type="checkbox" name="tandc" id="tandc" value='{chk}'><label for="tandc"> visits from previous 6 months</label>

MY ASPX PAGE: <asp:CheckBox ID="chkoffice" runat="server" Text="visits from previous 6 months"/><br />

CODE:

string body = string.Empty;

System.IO.StreamReader reader = new System.IO.StreamReader(HttpContext.Current.Server.MapPath("~/EmailTemplates/emailTemplate.html"));
body = reader.ReadToEnd();

body = body.Replace("{chk}",Convert.ToString( chkoffice.Checked));


Answers (1)