Auto Postback Issue

Y

yoyo

Hi,

I've added a button control in my webpage, and called a onClick event.

However it will always go back to the page load, then execute my onClick
event.

Is there a way which I can bypass page load??

Regards
 
O

Onur Bozkurt

If you want to skip some operations that are made in the Page Load, then you
can construct an if clause as
If not IsPostBack then
..operations you want to make in the load event...
End If
 
R

Ravi Sankar

You need to understand the event flow and sequence. During
postback the page load function is called before the
onClick event.
If u need to stop some action in the page load, u need to
use Page.IsPostBack to check if the page is called as the
first request or post back request and act accordingly.
Does this answer your question?
 
Y

yoyo

I get what you mean. But there's some actions in the page load that will be
used by other events.

And there's no way I can detect that the event comes from this onClick event
and stop a particular action.

So now I am researching whether I can go straight to the onClick function
without going to the page load.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top