Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

Postback

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Kennedy - 21 Jul 2005 22:07 GMT
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 - 21 Jul 2005 23:07 GMT
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/html/a
spnet-pageobjectmodel.asp


Regards

  Daniel Walzenbach

>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
[quoted text clipped - 3 lines]
> The variable only seems to change further down the order of events. Any
> ideas . Cheers, Chris.
Chris Kennedy - 22 Jul 2005 20:27 GMT
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.....

> 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
>
[quoted text clipped - 7 lines]
> > The variable only seems to change further down the order of events. Any
> > ideas . Cheers, Chris.
Victor Garcia Aprea [MVP] - 22 Jul 2005 01:12 GMT
Try moving your code after events are fired, i.e. PreRender event and see if
that works for you.

Signature

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

>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
[quoted text clipped - 3 lines]
> The variable only seems to change further down the order of events. Any
> ideas . Cheers, Chris.
Onin Tayson - 22 Jul 2005 11:14 GMT
Can u post some snippets?

>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
[quoted text clipped - 3 lines]
> The variable only seems to change further down the order of events. Any
> ideas . Cheers, Chris.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.