Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page_Init() and Page_Load()

Reply
Thread Tools

Page_Init() and Page_Load()

 
 
Christian
Guest
Posts: n/a
 
      07-16-2003
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


 
Reply With Quote
 
 
 
 
Cristian Suazo
Guest
Posts: n/a
 
      07-16-2003
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" <(E-Mail Removed)> wrote in message
news:nwhRa.14087$(E-Mail Removed)-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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM



Advertisments