R
RM
I have a "Custom Control" that takes a DataTable for a property and on
..Build(); renders a table showing products in cart, subtotals and the
like. Being a custom control, it of course has an HTML ascx, and a .cs
codebehind. 99% of the time it's used on various pages of a website.
I would like to be able to instantiate this control only in code (which
I can do now), Build it and then obtained the output HTML to a string.
The idea is to obtain the HTML and use it in an order confirmation
email. I'm not sure quite how to go about doing this.
I hope that makes sense. Basically what I'm saying is, I know how to
instantiate a custom control in code (C#) but Im not sure how to force
it to render and capture the rendering to a string so I can graft that
HTML into something else im building with a StringBuilder in code.
Thank you!
..Build(); renders a table showing products in cart, subtotals and the
like. Being a custom control, it of course has an HTML ascx, and a .cs
codebehind. 99% of the time it's used on various pages of a website.
I would like to be able to instantiate this control only in code (which
I can do now), Build it and then obtained the output HTML to a string.
The idea is to obtain the HTML and use it in an order confirmation
email. I'm not sure quite how to go about doing this.
I hope that makes sense. Basically what I'm saying is, I know how to
instantiate a custom control in code (C#) but Im not sure how to force
it to render and capture the rendering to a string so I can graft that
HTML into something else im building with a StringBuilder in code.
Thank you!