A few weeks back I posted looking for a way to send part of a html table in the body of an email from code behind.
The solution that works and was implemented was this logic:
StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter hw = new HtmlTextWriter(sw); gvDetails.RenderControl(hw); string html = sb.ToString();
But we recently added a ajax extender "AutoCompleteExtender" to the form/html table which is part of the above render logic, and now we are getting an error when the users submit the page and the email logic is executed.
We are getting the following error on the gvDetails.RenderControl(hw);
Extender control is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors(). Parameter name: extenderControl
Is there something I can do prior to the render to prevent this? Is there a way to exclude the extender from the render since I don't really need to email the extender?
I mean I kinda understand why we get the error, but unclear on how to get passed this..
The error is more of a nuisance because the form is in fact being submitted and the data is being captured in the DB, but as far as the user is concerned it failed and didn't work.