469,623 Members | 1,535 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Page_Init() and Page_Load()

Hi,

what is the purpose of having a Page_Init() AND a Page_Load() event handler
'cause both will always be executed on loading a page ?

What code do you typically put in one event or in the other event ?

thanks

chris
Nov 17 '05 #1
1 19520
When you need to restore the viewstate of a control on the webpage you
should create an instace of this webcontrol in the page_init. The reason for
this is that the viewstate is loaded between the init and the load event. So
this also means that is you want to access the value of a web control after
a postback you have to do this after the viewstate has been restored, so you
can not do this in the page_init.

This is one example, probably there are some more...

/Cristian
"Christian" <ch***************@pandora.be> wrote in message
news:nw******************@afrodite.telenet-ops.be...
Hi,

what is the purpose of having a Page_Init() AND a Page_Load() event handler 'cause both will always be executed on loading a page ?

What code do you typically put in one event or in the other event ?

thanks

chris

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by cheung | last post: by
6 posts views Thread by Dot net work | last post: by
4 posts views Thread by awalker1 | last post: by
10 posts views Thread by Wylbur via DotNetMonster.com | last post: by
12 posts views Thread by Nathan Sokalski | last post: by
5 posts views Thread by tshad | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.