Prerender changes get lost after Page.RenderControl

J

John Dalberg

I am trying to send a webpage with datagrids as an email so I use the code
snippet below. In one of my datagrids, I reformat some rows in the
datagrid's Prerender event. The code behind of the page displays the page
and sends the email. The page displays fine however the email has the same
look and everything *except* the changes that were made in the grid's
prerender. I think I am missing something and was wondering why the changes
were lost. I am thinking it's a timing issue. How can I get
Page.RenderControl() to execute the prerender event, wait till it's done
and continue to the next statement.


Code sample:
sw = new StringWriter();
htw = new HtmlTextWriter(sw);
Page.RenderControl(htw);
 
C

cbDevelopment

Where is your code being run? If you are executing your page code other
than in the page Prerender event, the page would not have called all its
child controls' prerender methods. If you stpe through your code, just
breakpoint every method and see the order in which the methods run.

Or you can do it in your prerender handler for the datagrid.

--
----
700cb Development, Inc.
http://www.700cb.net
..NET utilities, developer tools,
and enterprise solutions

(e-mail address removed) (John Dalberg) wrote in
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top