Use of server.htmlencode in class file
-
Good morning, I created class to send email. I use to send username in mail. I used _MailMessage.BodyFormat = MailFormat.Html and body text is created through code containing html table for formatting purpose ex. (" Name:txtname.text") It is working fine......I can send mail with table format. PROBLEM but if I use (" Name:Server.HtmlEncode(txtname.text)") It gives error "object reference not set to an insatance of an object" can I use Server.HtmlEncode in class file? Anybody has any solution plz disscuss with me.... Thanks, Nagraj
-
Good morning, I created class to send email. I use to send username in mail. I used _MailMessage.BodyFormat = MailFormat.Html and body text is created through code containing html table for formatting purpose ex. (" Name:txtname.text") It is working fine......I can send mail with table format. PROBLEM but if I use (" Name:Server.HtmlEncode(txtname.text)") It gives error "object reference not set to an insatance of an object" can I use Server.HtmlEncode in class file? Anybody has any solution plz disscuss with me.... Thanks, Nagraj
Hi, I find out the solution...... I just replace "<" with "<" and ">" with ">" and remove Server.HtmlEncode (" Name:ReplaceFunction(txtname.text)") I hope this will help to solve same problem to somebody else.. Thanks.... Nagraj