If I set a ViewState variable in the page_load event, then try to access
that same ViewState variable in the Page_Init event *after* a postback, the
variable's value is different. I only set it in this one place.
What is happening?
Thanks,
Craig Buchanan 4 4736
Page_Init happens before the state is recovered..
Regards
Jose
"Craig Buchanan" <so*****@somewhere.com> escribió en el mensaje
news:e4**************@TK2MSFTNGP09.phx.gbl... If I set a ViewState variable in the page_load event, then try to access that same ViewState variable in the Page_Init event *after* a postback,
the variable's value is different. I only set it in this one place.
What is happening?
Thanks,
Craig Buchanan
The LoadViewState Event occurs just after the Init Event. You want to access
it in some later Event. Shouldn't be hard, as the Init and LoadViewState are
the first 2.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Craig Buchanan" <so*****@somewhere.com> wrote in message
news:e4**************@TK2MSFTNGP09.phx.gbl... If I set a ViewState variable in the page_load event, then try to access that same ViewState variable in the Page_Init event *after* a postback,
the variable's value is different. I only set it in this one place.
What is happening?
Thanks,
Craig Buchanan
Kevin-
Thanks for the response. Why don't I see the LoadViewState event in the
page event list?
Craig
"Kevin Spencer" <ke***@takempis.com> wrote in message
news:eg**************@tk2msftngp13.phx.gbl... The LoadViewState Event occurs just after the Init Event. You want to
access it in some later Event. Shouldn't be hard, as the Init and LoadViewState
are the first 2.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Craig Buchanan" <so*****@somewhere.com> wrote in message news:e4**************@TK2MSFTNGP09.phx.gbl... If I set a ViewState variable in the page_load event, then try to access that same ViewState variable in the Page_Init event *after* a postback, the variable's value is different. I only set it in this one place.
What is happening?
Thanks,
Craig Buchanan
Hi Craig,
It is a common Event of all System.Web.UI.Control classes. The following
link shows the entire Control Execution LifeCycle for all Server Controls: http://msdn.microsoft.com/library/de...nLifecycle.asp
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Craig Buchanan" <so*****@somewhere.com> wrote in message
news:#H**************@TK2MSFTNGP12.phx.gbl... Kevin-
Thanks for the response. Why don't I see the LoadViewState event in the page event list?
Craig
"Kevin Spencer" <ke***@takempis.com> wrote in message news:eg**************@tk2msftngp13.phx.gbl... The LoadViewState Event occurs just after the Init Event. You want to access it in some later Event. Shouldn't be hard, as the Init and LoadViewState are the first 2.
-- HTH, Kevin Spencer .Net Developer Microsoft MVP Big things are made up of lots of little things.
"Craig Buchanan" <so*****@somewhere.com> wrote in message news:e4**************@TK2MSFTNGP09.phx.gbl... If I set a ViewState variable in the page_load event, then try to
access that same ViewState variable in the Page_Init event *after* a
postback, the variable's value is different. I only set it in this one place.
What is happening?
Thanks,
Craig Buchanan
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: wASP |
last post by:
I thought it was something relatively simple:
ViewState = SomeObj;
Then:
SomeObj = ViewState;
So, in my own code, I have this on the initial load:
|
by: John |
last post by:
Hi all,
I have a problem with viewstate being maintained. I use LoadControl to load
a user control and the data is sent down to the client correctly. However,
when I change some data and post...
|
by: Steve Drake |
last post by:
All,
I have a CONTROL that contains 1 control (Control ONE), the 1 control that
it can contain 1 or 2 control (Control A and B).
Control A, raises and event and Control ONE receives this event...
|
by: Chuck Ritzke |
last post by:
Hi,
I've searched the newsgroup and other sources to understand how to handle
runtime controls and see I'm not the only one who's confused, but I'm still
not quite sure of the best way to handle...
|
by: Gauthier Segay |
last post by:
Hello,
I've problem on subsequent postbacks after a Server.Transfer was done.
In our application framework we have a method that pass parameters (via
HttpContext.Items) and navigate to another...
|
by: hitendra15 |
last post by:
Hi
I have created web user control which has Repeater control and
Linkbutton in ItemTemplate of repeater control, following is the code
for this control
On first load it runs fine but when...
|
by: Alexander van Doormalen |
last post by:
I have a situation that user controls are dynamically loaded within a
page. To know which control to 're-add' to the page I saved the control
path in the ViewState. This Control is added using...
|
by: Steph |
last post by:
Hello, i found a bug ? or an incompetence of my share !
I've 1 aspx and 3 ascx level : as :
Default.aspx :
PlaceHolder1 < Page_Init : LoadControl(1.ascx)
module.ascx :
PlaceHolder1 <...
|
by: Aaronius |
last post by:
I do admit I am fairly new to ASP.NET. With that, I've also poured over dozens of websites and forum posts, sifted through pages of text, and spent hours stuck on this problem. I'm now pleading for...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |