Page.isPostBack ????

Discussion in 'ASP .Net' started by =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Sep 23, 2005.

  1. 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
     
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Sep 23, 2005
    #1
    1. Advertising

  2. 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" <> wrote in
    message news:...
    > 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
    >
     
    S. Justin Gengo, Sep 23, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=

    Karl Seguin Guest

    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" <> wrote in
    message news:...
    > 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
    >
     
    Karl Seguin, Sep 23, 2005
    #3
  4. =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=

    Mark Rae Guest

    "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
    wrote in message news:%...

    > 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...
     
    Mark Rae, Sep 23, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. luna
    Replies:
    4
    Views:
    8,269
  2. Pravin
    Replies:
    2
    Views:
    515
    Anatoly
    Feb 16, 2004
  3. DotNetGruven
    Replies:
    3
    Views:
    15,303
  4. Eric Lawrence [MSFT]

    Re: Force Page.IsPostBack to occur

    Eric Lawrence [MSFT], Mar 4, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    391
    Eric Lawrence [MSFT]
    Mar 4, 2004
  5. Joey
    Replies:
    2
    Views:
    4,017
Loading...

Share This Page