.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

System.Web.UI.ViewStateException: Invalid viewstate.

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :ASP.Net

I had to switch to

sessionState mode="StateServer" timeout

View Complete Post

More Related Resource Links

System.InvalidOperationException: Invalid attempt to read when no data is present.


Invalid attempt to read when no data is present.

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.InvalidOperationException: Invalid attempt to read when no data is present.

Source Error: 

Line 53:             if (reader.HasRows)
Line 54:             {
Line 55:                 Response.Write(reader.GetString(0));

Here is my code:

Invalid viewstate - AGAIN.

I'm getting 100+ errors per day on my website with System.Web.HttpException: Invalid viewstate. at System.Web.UI.Page.DecryptStringWithIV The website is asp.net 3.5 running on iis6 , not running in a web-garden/web-farm , single server. The website is using xhtml doctype. viewstate size vary from 2kb-20kb Here are a few sample errors.Machine: ML Framework Version: 2.0.50727.3603 Assembly Version: 6.5.3664.33889 Source: http://www.domain.com/WebResource.axd?d=z5VmXXoSLLpQHoPictureAlert Exception: System.Web.HttpException: Invalid viewstate. at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Machine: MLFramework Version: 2.0.50727.3603 Assembly Version: 6.5.3664.33889 Source: http://www.mydomain.com/ScriptResource.axd?d=SE0Ej7OlEAx91j2Cjv_6KkRPplqT-5wB4M7CZPdGdGn3LahLwqlRPApUcdxBsbFXYHZ91Q76FHAHWgHs8SmOC4zemr7 siym0QY0rF3XtJTu%3C/a%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ca%20id= Exception: System.Web.HttpException: Invalid viewstate. at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)

invalid viewstate

Hi I am getting error when i try to edit or modify web part on page. System.Web.UI.ViewStateException: Invalid viewstate. Client IP: Port: 1133 User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2) ViewState: mq/FycjpF0z0RBSQj9IPsl469oBAxMYb6NLa0xbPRwuAAqEz81Bkm4H7m04hl8lP4I/ThaGy0rit1q62UXz2PTaUGWdXml11UdC4LiUp4ZQ9Q3Ki/792Zvix4D+lFsHBiRIYxv802qXC4De9luhW+Ksb7sVC7p6SLGJeN88B+WMI3y28DpVUo208MVuWOyeT0kzOEoX4Acj9PZIOf1Jp4cYijKD3V/J8djhry/Bvjj2NFn1O3ynduc9cYhu4wp5NHWpsRLtoZBChbiN5jXwZsKj5qWQkl+SVO9OQV63Vc7B8Rvr8tyj0+om+J4xvvkAWosEN9HUerNTESM1XVr4qSNyvBuC2f617r/aUwJ1y6REWG/07AfvG832FE6jf6Qi24B+tXrUtAqEyNzm+in0EK5Xto5+ReBU3zZThhpctuemjc0jr3owVaNCxKx7t93xwH2edG3c28E9urXJrMvzzEgw6UbQpV2ad7od0fN5J8FG/Wumn1VByF9y2q4zuJyK8WPhjxAlFPE7tTEkzyUK6fM7oHiy14oyUEzTDGMsaAxrZOyZHroe8iQkAW8gD+c3Xb9BYU4PGDi3hjdkNt72nWfg4OlRwCIgyRKhE8yUEitlmaVNcthf7Ck35yBGHGMptr1WYffYICRai68R7E2MuANYXc/Z9p0QoX/o0e9Ywbp6waZeeVee/x6ra90suOjU1wkziINNiqbgN5Gdj4tsX2h3MI01/+AR2x1NOaKHOfoAIcaFk0utJ/077ijxohVqZpEJbIBZEygrwJMF534A/UDSIz01yk... ---> System.Web.HttpException: Unable to validate data. at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, B

System.Data.SqlClient.SqlException: Invalid object name


I am getting this error message

System.Data.SqlClient.SqlException: Invalid object name 'Members'.

The database name is ACEStaff

I copied it accross from my old server to my new one

The table name in the database is Acestaffrm.members. Is the Acestaff prefix giving me this problem. I notice other table have dbo. prefix

Any suggestions on the problem here



System.ArgumentOutOfRangeException 'ComboBox' has a SelectedIndex which is invalid because it does



I think I have a complicated one here.

Synopsis: I have a AJAX enabled ASP.Net application, the purpose of which is to allow users to ad hoc drill an engineering database.  The application UI is divided into three sections, Filtering, Column Selection, and Results. The filtering section (implemented as a user web control) uses a PlaceHolder control, to which I allow addition and removal of individual Filter user controls.

All of that works well. The Filter user control essentially consists of three ComboBox controls with SqlDataSources bound to each of those ComboBoxes, and a TextBox to enter in a value. The first ComboBox, once a value is selected in its list, passes the SelectedValue to the SqlDataSource of the next ComboBox, which uses that value as a Select Parameter so the DataSource can fill out the ListItems of the next ComboBox. So simply, the results of the previous one cascade to the next.

Again, all this worked well. But one of the requirements was to allow storage of these queries the customer comes up with, allowing them to reload the query at a later time to run again.

I implemented that by writing a simple set of container classes, Filter, Column, and Query, where Query has public arrays of Filters and Columns. I serialize that simple Query object, then store it as XML in my database. To reload i

System.Management.ManagementException: Invalid parameter


I have created a windows Service which invokes executables on remote machines, waits for it to complete and then proceeds to the next machine on the network.
The Account type for the windows Service is "Network Service". For monitoring if the process is completed on the remote machine, I am using ManagementEventWatcher class. I get the following error when I start the Management event watcher object.

System.Management.ManagementException: Invalid parameter
at System.Management.ManagementException.ThrowWithExt endedInfo(ManagementStatus errorCode)
at System.Management.ManagementEventWatcher.Start()

The code (VB.net 1.1) I am using is as follows:

Dim connection As New System.Management.ConnectionOptions
connection.Username = v_sUserName
connection.Password = v_sPassword
connection.EnablePrivileges = True

Dim oPath As New ManagementPath("\\" & v_sServerName & "\root\CIMV2")
Dim oScope As New System.Management.ManagementScope(oPath, connection)
oScope.Options.Impersonation = ImpersonationLevel.Impersonate

Dim processClass = New System.Management.ManagementClass("Win32_Process")
processClass.Scope = oScope

Dim inParams = processClass.GetMethodParameters("Create")

What would cause an Invalid viewstate?


I'm seeing page failures and all the information I have is Invalid Viewstate.  What would cause this?

Getting "System.UriFormatException: Invalid URI: The URI is empty."


I have some code which is a wrapper "DLL" I used the DLL in a VB6 app in order to call a web service, and invoke a web method. I'm using the same DLL wrapper for an ASP.NET 2008 web portal site. The wrapper class was created in VS 2008. A little about the wrapper code: Basically I create a BasicHttpBinding object, set the basic propties of the object, this way I can eliminate te need for a web config in the wrapper class. I then create my proxy object for the web service in which I’m going to call within the wrapper class passing it the BasicHttpBinding an a new EndpointAddress. The wrapper class exposes a single method, see code below:

Paraemters defined:

pwd: password in order to login to web service

System.ArgumentException: Invalid postback or callback argument.


Is there a good way to test and debug these errors.  I constantly get them emailed to me from my production site but I can not duplicate them.  Below is the entire error.

User: jbrown
Session[STUser] = DAL.stUser
Session[PlaylistName] = Adult Contemporary Holiday Blend 2010 (vol. 2)
Session[PlaylistId] = 3865
Session[SES-FAN] = SessionFan
Session[fullPreview] = yes
System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %>in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.

RegisterForEventValidation method in order to register the postback or callback data for validation. at System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Exception of type 

Ajax toolkit error : System.InvalidProgramException: Common Language Runtime detected an invalid pro


I have website that uses .NET 3.5 and Ajax tool kit.  The strange thing is it works fine in two environments but it errors with the following error on production site:


Server Error in '/UPS' Application.

Common Language Runtime detected an invalid program.

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.InvalidProgramException: Common Language Runtime detected an invalid program.

Source Error:

Line 13:     <aj:ComboBox ID="ComboBox1"  runat="server">
Line 14:     </aj:ComboBox>
Line 15:     <aj:MaskedEditExtender MaskType="Number" ID="MaskedEditExtender1" Mask="(###)" TargetControlID="txt1" runat="server">
Line 16:     </aj:MaskedEditExtender>
Line 17:   

Source File: d:\Search\UPS\TestAjax.aspx    Line: 15

Stack Trac

System Development Life Cycle

The Systems Development Life Cycle (SDLC) is a conceptual model used in project management that describes the stages involved in an information system development project from an initial feasibility study through maintenance of the completed application. Various SDLC methodologies have been developed to guide the processes involved including the waterfall model (the original SDLC method), rapid application development (RAD), joint application development (JAD), the fountain model and the spiral model. Mostly, several models are combined into some sort of hybrid methodology

The Agile System Development Life Cycle (SDLC)

The goal of this article is to describe the agile system development life cycle (SDLC), putting it in context from what you may have heard about within the agile community and more importantly within the context of your overall IT efforts.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.



hello i have the following problem

i have upload my content to hosting server but i get the following error

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

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:

[SecurityException: Request for the permission of typ

Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPerm


Good Day all,

Having an issue with an outside user accessing my IIS7 box. I do not have this problem when running the website from my host machine. I found this post: Http://forums.asp.net/t/1371394.aspx. I assure you that this is not a solution because I am not storing any of my files on a network share. 

What do you think my approach should be. 

I already have read rights to IIS user to my BIN folder. 

Thanks for the help. 

System.IO.Packaging is not visible


I am new to ASP.net, I installed VS2005 and IIS 5 on my PC and set up my first website using IIS (not the embedded webserver in VS).

For some reason I cannot find the Assembly: "System.IO.Packaging", please let me know if I am allowed to use it in that medium and how can I reference it?

Thanks in advance.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend