ASP.NET removing the viewstate

Associate
Joined
18 Oct 2002
Posts
1,044
Hi

I'm having some problems writing an asp.net app, I need to remove the viewstate hidden input field from a form (the browser I'm writing for allocates the space for hidden form fields) . I've tried disabling at the usercontrol level, the page level, and in web.config. Is there anywhere else that might be causing this to be added?

I'm more than happy to store all my information in a session variable and all the controls i'm using are really simple ones (buttons, dropdown lists etc), so I don't know why asp.net keeps adding it....

akakjs
 
[edit]sorry saw your correction[/edit]

I don't use the design-view ever (in fact if I could do it I would remove it completely), everytime you load it it pushes your HTML through a modified version of the IE rendering engine, and it comes out **** with weird formatting, etc. I have all of Visual Studio's formatting disabled, it saves me days when working on big projects....

I tried turning it off programaticly & in the @Page thing, no joy :(

akakjs
 
Last edited:
are you using the old version of visual studio then as I though the HTML rendering problem was sorted in the new version.
As I understand 2005's html rendering is better, but it still rearranges. I understand the logic is to minimise the difference between in the visual between the designer and internet explorer (rather a short sighted stratagy imho as I try to write cross-browser compatable websites :) ).

Doesn't really matter anyways as I want to write it in .NET 1.1 which means visual studio 2003 (I write in 1.1 at work, and switching between 2.0 and 1.1 was slowing down my coding in both, as I couldn't remember which features where in which :) ).

userControlID.EnableViewState = False

I did try that but I wasn't sure I got every thing that could create the viewstate

Does everything that inherate from the webcontrol base class have the potentual to create the viewstate?

Thanks for all the help :D

akakjs
 
Beepcake said:
LoadPageStateFromPersistenceMedium() and SavePageStateToPersistenceMedium() are the two functions you need to override IIRC.
Cool. that seems like the best route to take for the moment, thanks for the help :D

akakjs
 
Back
Top Bottom