How to supress pre-render evnet when page post back

J

JG

Hi all,
I have a simple aspx page. On the page there is only one button. When I
click on the button, the event sequence is Page_Load, Button1_click and
Page_PreRender. How do I supress the PreRender event? I know if I call
Server.Transfer or Reponse.Redirect in the Button1 click event, the page
prerender event will not occur.
Thanks.

Jie
 
S

Scott Allen

Hi JG:

Trying to stop the PreRender event is trying to swim upstream against
the current. There are probably easier ways to achieve what you need
to do. What's the ultimate goal of trying to whack PreRender?
 
J

Jie

Hi, Scott,
My goal is to avoid the process in pre-render event. In the Button1 click
event, I open a new aspx page using Java script. The first page will not be
used after the second page is loaded. It is necessay to run the codes in the
pre-render event at this situation because this page is not used at all. I
know I can set such as bStopPreRender = True in the button click event and
check the value of bStopPreRender in the prerender event. I am wondering if
there is any way to stop the pre-render event. Thanks

Jie
 
S

Scott Allen

Hi Jie:

I think setting the flag is a safer approach, and easier for everyone
to see what is happening.
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top