Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page.isPostBack ????

Reply
Thread Tools

Page.isPostBack ????

 
 
=?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=
Guest
Posts: n/a
 
      09-23-2005
Dear all,

Is there any particular rules on the type of code we usually place inside
the Page load event and checking the IsPostback status ?

As a beginner I could imagine to put quite many things inside this Postback
condition but I doubt it is the tight way to do

regards
serge

 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      09-23-2005
Serge,

I use the following template inside the page load event and then put my code
in the necessary spots:

Try

'---Every page load

If Not IsPostBack Then

'---First page load only

Else

'---Post back only

End If

'---Every page load

Catch ex As Exception

'---Process Exception

End Try


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"serge calderara" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Dear all,
>
> Is there any particular rules on the type of code we usually place inside
> the Page load event and checking the IsPostback status ?
>
> As a beginner I could imagine to put quite many things inside this
> Postback
> condition but I doubt it is the tight way to do
>
> regards
> serge
>



 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      09-23-2005
The main use for IsPostBack is that you initially set control values when
IsPostBack is false (the page is first loaded) but don't want to do so when
it's true, because the control values will be repopulate from viewstate.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"serge calderara" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Dear all,
>
> Is there any particular rules on the type of code we usually place inside
> the Page load event and checking the IsPostback status ?
>
> As a beginner I could imagine to put quite many things inside this
> Postback
> condition but I doubt it is the tight way to do
>
> regards
> serge
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      09-23-2005
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%(E-Mail Removed)...

> The main use for IsPostBack is that you initially set control values when
> IsPostBack is false (the page is first loaded) but don't want to do so
> when it's true, because the control values will be repopulate from
> viewstate.


Added to this, if you have any databound controls e.g. DropDownList controls
etc, populate them in the Page_Init event, not the Page_Load event...


 
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




Advertisments