CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 4/26/2004 9:17:43 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 32 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
thenetrealtor
Asp.Net User
Temporarily disable LoadViewState4/26/2004 9:17:43 PM

0/0

Using dynamic UserControl loading, as an optimization I am looking at
the events causing a postback.

When this event is unrelated to the UserControl that was part of the page that was posted,
I skip the reload of said UC.

If the event in question to load a new UC, I do this.

Herein the problem occurs.

Since I am in a PostBack situation, when I load the new UC it appears the page system
is attempting to load The current View state which is for the previous UC.

Not too bad of a problem in that you can catch the exception and ignore it and carry on,
but I am seeing some slight side effects such as fields in the new UC having the wrong visibility and similar problems.

I am fairly sure this is related to the ignored ViewState exception. It is caught and
tossed.

My question is:

Is there a way to temporarily disable the LoadViewState while loading the new UC,
but not totally disabling it as I use it during a postback which actually is related to the
UC previously loaded.

Regards
master4eva
Asp.Net User
Re: Temporarily disable LoadViewState4/26/2004 9:56:27 PM

0/0

I see what your purpose is and if you follow the blog entry that I have made, you will see the light:

http://blogs.aspadvice.com/jlovell/archive/2004/02/11/502.aspx
-- Justin Lovell
thenetrealtor
Asp.Net User
Re: Temporarily disable LoadViewState4/27/2004 8:23:18 AM

0/0

Thanks, in a left-handed sort of way.

I read your blog and decided to move my check for whether or not I needed to
reload my UC to the init event of the BasePage. The ReloadUC() routine
determines what event caused the Page to be reloaded

OnInit()

....
if(!ReloadUC())
this.EnableViewState = false;

...

Then just before I load the new control, I turn ViewState back on

this.EnableViewState = true;

and the result is no more exceptions and ViewState works fine when I need to reload
the same UC.

No more wierdness on my UC's either.

Obviously, this only works due to the fact that all input is in my UC's, and non-UC
events are just menu selections and such.

It also works perfectly when a page is posted which was arrived at via the
BACK/FORWARD browser buttons, which was one of my goals.

So, if thats what you meant thanks for the tip, if not, well you got me there anyway ,,

Cheers

master4eva
Asp.Net User
Re: Temporarily disable LoadViewState4/27/2004 11:36:50 AM

0/0

Read in the talk -- it says that view state is restored to the controls in the Init part of the life cycle. So what you do is: do all your work over here when you do want view state to override your changes. For example, you have the following code (in pseudo form):

protected override void OnInit(EventArgs e) {
data bind to datagrid
add data grid to control
base.OnInit(e);
}

-- Justin Lovell
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
CodeProject: ASP.NET Internals: Viewstate and Page Life Cycle ... Mar 24, 2008 ... So, even if you wanted to disable Viewstate on the DataGrid and rebind the ... Viewstate in the “LoadViewState”and “SaveViewState” events ...
ASP.NET Client Side State Management - ViewState - Gil Fink on .Net May 7, 2008 ... In the LoadViewState (occurs only after postbacks) all the ... Pay attention that if you need to save your state and you disable ViewState ...
ASP.NET - ViewState - Client Side State Management | .NET Zone Jul 3, 2008 ... In the LoadViewState (occurs only after postbacks) all the data is ... save your state and you disable ViewState it is your responsibility ...
Understanding ASP.NET View State NET\Framework\Version\Temporary ASP.NET Files folder and open one of the .cs ..... Similarly, on postbacks, the load view state stage needs to deserialize ...
viewstate NET but you can disable it, as necessary, by setting the ... and assuming ViewState is enabled, that the LoadViewState method is executed ...
CodeProject: ASP.NET Internals: Viewstate and Page Life Cycle ... Mar 24, 2008 ... If you want a proof, disable the Viewstate on your TextBox control or even .... Viewstate in the “LoadViewState”and “SaveViewState” events ...
Vault of Thoughts - .NET Blog - ASP.NET Similarly, when loading the state in the LoadViewState method you get your ...... This may be very usefull if what you want is to temporarily disable some ...
Koders Code Search: RequestFilters.ascx.vb - VB.NET - MITD LoadViewState(myState(0)) End If If Not (myState(1) Is Nothing) Then Dim .... Save(Rules) Else If AddMode Then 'Remove the temporary added row Rules. ...
Someone rescue me! Critical Exception in DNN 4.5.5 > DotNetNuke ... PageLoadException: Failed to load viewstate. ... If you do, try disabling it. Also, have you been playing with the performance variables ...
Venexus DotNetNuke Blog - Wednesday, 21 June 2006 InnerException: Failed to load viewstate. The control tree into which viewstate is ..... If for some reason you need to temporarily allow inserts into the ...




Search This Site:










how to register custom control globally

opinions on softsyshosting?

my apache webserver is publicly accessible only from certain ip addresses

custom compositecontrol surrounded by <span> tag

i am a beginner and need help

little (very) help please

adding control during render

invalid character in base 64 string?

asp.net web forms control identification id & javascript

help-creating user control for left side menu that spans the whole page.

custom control: implementing toolbox support

using controls that i download on the site

user control won't import user-defined namespace

inheritance to control?

why webcontrols do not expose javascript events?

email

dedicated server or virtual dedicated server

using controlpersister.persistcontrol at run time

look for server component to convert .doc into mhtml

improving security

dropdownlist requery

webformdesigner

how to write data to htmlinputhidden?

custom dataadapter component

really need help solving long standing issue with designing controls that share base classes

using a custom nav control in all my pages

the best service of asp .net 2.0

windows hosting ts printing nightmares

recomendations for a third part monitoring company

database deployment problems

  Privacy | Contact Us
All Times Are GMT