473,657 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't access sending Web Forrm's ViewState

Dee
Hi
I have added

EnableViewState Mac="false"

to the sending WebForm's @Page Directive and my sample code has the
following line:

Dim coll As System.Collecti ons.Specialized .NameValueColle ction
collForm = Request.Form
Dim n As Int16 = collForm.Count ' <-------- I get zero for this.

Why do I get an empty collection where the sending WebForm has many
server-side controls on it?

Thanks.
Dee


Nov 19 '05 #1
2 1246
Dee
Actually when I attempt to go to the second page using:

Server.Transfer ("result.asp x", True)

I get the following error message:

~~~~
The View State is invalid for this page and might be corrupted.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: The View State is invalid
for this page and might be corrupted.

Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:
[HttpException (0x80004005): The View State is invalid for this page and
might be corrupted.]
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium()
System.Web.UI.P age.LoadPageVie wState()
System.Web.UI.P age.ProcessRequ estMain()
~~~~
"Dee" <dee@home> wrote in message
news:uy******** *****@TK2MSFTNG P10.phx.gbl...
Hi
I have added

EnableViewState Mac="false"

to the sending WebForm's @Page Directive and my sample code has the
following line:

Dim coll As System.Collecti ons.Specialized .NameValueColle ction
collForm = Request.Form
Dim n As Int16 = collForm.Count ' <-------- I get zero for this.

Why do I get an empty collection where the sending WebForm has many
server-side controls on it?

Thanks.
Dee

Nov 19 '05 #2
Dee
Got it, had to include EnableViewState Mac="false" in both sending and
receiving codebehinds.
"Dee" <dee@home> wrote in message
news:Ow******** *****@TK2MSFTNG P15.phx.gbl...
Actually when I attempt to go to the second page using:

Server.Transfer ("result.asp x", True)

I get the following error message:

~~~~
The View State is invalid for this page and might be corrupted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.Http Exception: The View State is invalid
for this page and might be corrupted.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:
[HttpException (0x80004005): The View State is invalid for this page and might be corrupted.]
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium()
System.Web.UI.P age.LoadPageVie wState()
System.Web.UI.P age.ProcessRequ estMain()
~~~~
"Dee" <dee@home> wrote in message
news:uy******** *****@TK2MSFTNG P10.phx.gbl...
Hi
I have added

EnableViewState Mac="false"

to the sending WebForm's @Page Directive and my sample code has the
following line:

Dim coll As System.Collecti ons.Specialized .NameValueColle ction
collForm = Request.Form
Dim n As Int16 = collForm.Count ' <-------- I get zero for this.

Why do I get an empty collection where the sending WebForm has many
server-side controls on it?

Thanks.
Dee


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1661
by: Ken Varn | last post by:
I am trying to cut down the amount ViewState data that is passed to the client browser. I have a number of Web Server Controls on my page, but I am confused as to when ViewState can be disabled to save on web traffic. For instance.... I have several drop down listboxes. If I disable ViewState, then my server side code cannot obtain the selected item when the form is submitted. The thing that confuses me is that this should be...
5
7660
by: Steve Richter | last post by:
In my user control I want to read the ViewState dictionary of the Parent control. But this sensible idea is not permitted by the compiler: Compiler Error Message: CS1540: Cannot access protected member 'System.Web.UI.Control.ViewState' via a qualifier of type 'System.Web.UI.Control'; the qualifier must be of type 'ASP.ItemOrderGrid' (or derived from it) Source Error:
7
2990
by: Shimon Sim | last post by:
I have a custom composite control I have following property
1
1656
by: Nathan Sokalski | last post by:
I have a problem that is driving me crazy. I have a User Control composed of three DropDownLists that will be used to select a date. I have everything working except for one thing. When I select a new value from one of the DropDownLists, the code still returns the old value. You will notice that I try to access the SelectedIndex property in DateChanged, which is the eventhandler for all three SelectedIndexChanged events, although I could put...
1
2155
by: Lars Netzel | last post by:
I have an XLS file that I try to send to the webclient via ASP.NET. When sending I use this code... Response.ClearContent() Response.ClearHeaders() Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("Content-Disposition", "inline; filename=" & ClientFilename & ".xls")
0
1016
by: Paul | last post by:
Hi all, I have a simple custom control with a label and a text box. The text control's value is persisting when I do a post back, so the view state is working, but I cannot access the value in the code. Is there anything different I have to do to expose the value of the text box? testControl.Text returns the unchanged original value, not the new value.
0
1660
by: Walter | last post by:
Hi, can someone please help me with my custom control viewstate problem....I haven't slept for hours trying to get this fixed. I am making two custom controls which will be included on a single page. For now, I will call them box1 and box2. Each box has a panel and will display a list of link buttons on the panel. When the page loads for the first time, box1 will call the database and create a list of linkbuttons and each link button has...
2
2058
by: Chris | last post by:
I have created a date picker user control. I want to have a boolean property, which I can set to determine whether the control defaults to today's date. I have created a property which I set to true but when I create the child controls it has always reset to false. I know it has been set to true as I have trace written the value in the property "setter". Is the create child controls event the wrong place to set the textbox, with the date....
1
1839
by: blad3runn69 | last post by:
Hello, Was hoping someone could suggest possible causes for form command button shortcut keys (ie. ALT+key) not to respond. Thanks :) The form is a search forrm. Shortcuts only work when there are filtered results diplayed. Hope this makes some sense. Thanks in advance for your help and ideas muchly appreciated! :)
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.