Is it possible to call button click event before page load on postback

G

GauravGupta

i am displaying a table in page load whose data is fetched from
database .
it also check what data is to be displayed from data base by a
session
variable.
and i have few button which change the session variable value.
when i click on some button page load is called before button click
event,
so data which is displayed is according to previous session not the
session changed by button click.
therefore i want that some how i call button click event before page
load event....
or is there any other alternative...
 
N

nahid

i am displaying a table in page load whose data is fetched from
database .
it also check what data is to be displayed from data base by a
session
variable.
and i have few button which change the session variable value.
when i click on some button page load is called before button click
event,
so data which is displayed is according to previous session not the
session changed by button click.
therefore i want that some how i call button click event before page
load event....
or is there any other alternative...

this is basic nature of web programming. fetched data in if(!
ispostbacl){} block
it may help...can you please copy paste some code here

nahid
http://nahidulkibria.blogspot.com/
http://kaz.com.bd
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

GauravGupta said:
i am displaying a table in page load whose data is fetched from
database .
it also check what data is to be displayed from data base by a
session
variable.
and i have few button which change the session variable value.
when i click on some button page load is called before button click
event,
so data which is displayed is according to previous session not the
session changed by button click.
therefore i want that some how i call button click event before page
load event....
or is there any other alternative...

The control events happens after the Load event, and you can't change that.

Display the data in the PreRender event instead, as that happens after
the control events.
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top