Postback

Discussion in 'ASP .Net' started by Daniel Walzenbach, Jul 21, 2005.

  1. Chris,

    chech out the lifecycle of the page. The button click event fires AFTER the
    page.Load event which is why your have to click your button twice.
    For a little background reading you might have a look at the following
    article:
    http://msdn.microsoft.com/asp.net/d.../en-us/dnaspp/html/aspnet-pageobjectmodel.asp

    Regards

    Daniel Walzenbach


    "Chris Kennedy" <> schrieb im Newsbeitrag
    news:...
    >I have a button which sets a vaiable in session. I retrieve the session the
    > page load event. I seem to need to press the button twice for the variable
    > to change (I am tracing it to see what the variable is). I am I
    > misunderstanding something?
    >
    > The variable only seems to change further down the order of events. Any
    > ideas . Cheers, Chris.
    >
    >
    Daniel Walzenbach, Jul 21, 2005
    #1
    1. Advertising

  2. Try moving your code after events are fired, i.e. PreRender event and see if
    that works for you.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Read my weblog:
    Followers of the IHttpHandler
    http://clariusconsulting.net/vga


    "Chris Kennedy" <> wrote in message
    news:...
    >I have a button which sets a vaiable in session. I retrieve the session the
    > page load event. I seem to need to press the button twice for the variable
    > to change (I am tracing it to see what the variable is). I am I
    > misunderstanding something?
    >
    > The variable only seems to change further down the order of events. Any
    > ideas . Cheers, Chris.
    >
    >
    Victor Garcia Aprea [MVP], Jul 22, 2005
    #2
    1. Advertising

  3. I have a button which sets a vaiable in session. I retrieve the session the
    page load event. I seem to need to press the button twice for the variable
    to change (I am tracing it to see what the variable is). I am I
    misunderstanding something?

    The variable only seems to change further down the order of events. Any
    ideas . Cheers, Chris.
    Chris Kennedy, Jul 22, 2005
    #3
  4. Daniel Walzenbach

    Onin Tayson Guest

    Can u post some snippets?

    "Chris Kennedy" <> wrote in message
    news:...
    >I have a button which sets a vaiable in session. I retrieve the session the
    > page load event. I seem to need to press the button twice for the variable
    > to change (I am tracing it to see what the variable is). I am I
    > misunderstanding something?
    >
    > The variable only seems to change further down the order of events. Any
    > ideas . Cheers, Chris.
    >
    >
    Onin Tayson, Jul 22, 2005
    #4
  5. It's a little long winded to explain what I am doing. I want the button
    click to do something to an XML file before the page reloads. I now
    understand this is not how the postback process works. Is there any way of
    triggering the postback twice. I know its a hack.....

    "Daniel Walzenbach" <> wrote in message
    news:#...
    > Chris,
    >
    > chech out the lifecycle of the page. The button click event fires AFTER

    the
    > page.Load event which is why your have to click your button twice.
    > For a little background reading you might have a look at the following
    > article:
    >

    http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/ht
    ml/aspnet-pageobjectmodel.asp
    >
    > Regards
    >
    > Daniel Walzenbach
    >
    >
    > "Chris Kennedy" <> schrieb im Newsbeitrag
    > news:...
    > >I have a button which sets a vaiable in session. I retrieve the session

    the
    > > page load event. I seem to need to press the button twice for the

    variable
    > > to change (I am tracing it to see what the variable is). I am I
    > > misunderstanding something?
    > >
    > > The variable only seems to change further down the order of events. Any
    > > ideas . Cheers, Chris.
    > >
    > >

    >
    >
    Chris Kennedy, Jul 23, 2005
    #5
    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. Psych971
    Replies:
    5
    Views:
    4,594
    bruce barker
    Dec 17, 2004
  2. =?Utf-8?B?Q2hhZA==?=

    Postback not being set to True on first postback

    =?Utf-8?B?Q2hhZA==?=, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    483
    =?Utf-8?B?Q2hhZA==?=
    Apr 4, 2005
  3. gce
    Replies:
    2
    Views:
    1,694
  4. Jacky Chau
    Replies:
    2
    Views:
    2,022
    Ninjamyst
    Jun 8, 2005
  5. Fabio Mastria
    Replies:
    5
    Views:
    4,328
    TechMCAD13
    Jan 30, 2008
Loading...

Share This Page