473,388 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Invalid viewstate (System.String DecryptStringWithIV

The Script Resource and the Web Resource files are generating intermittent errors in my application. I have been trying to chase the cause of the problem but to no avail. I notice that the “d” parameter that is passed is some how corrupted and I can’t for the life of me figure out what’s causing this parameter to be corrupted. I noticed that JavaScript code that in my application is some how getting intertwined with the hash code that’s generated for the “d” parameter. I have below the entire stack trace:

Exception genereated on Monday, January 26, 2009, at 2:20 AM
Page location: /ScriptResource.axd?d=y9_dUwBeGqLlRpT5Dml1zhoQvfa7N Kdj69EYuV771kzSsa5KOOXBfJZjk%20%20%20%20%20%20%20% 20%20%20%20%20if%20(cat_gallery%20!=
Requested Url : Buy Garmin GPS Nuvi 350, Nuvi 660, C330 and more at Garmin Factory Outlet Store if (cat_gallery !=
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
Method: System.Object _InvokeMethodFast(System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttributes, System.RuntimeTypeHandle)
Stack Trace: at System.RuntimeMethodHandle._InvokeMethodFast(Objec t target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at System.Web.Handlers.ScriptResourceHandler.DecryptS tring(String s) at System.Web.Handlers.ScriptResourceHandler.DecryptP arameter(NameValueCollection queryString) at System.Web.Handlers.ScriptResourceHandler.ProcessR equest(HttpContext context) at System.Web.Handlers.ScriptResourceHandler.System.W eb.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e() at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
Inner Exception: System.Web.HttpException: Invalid viewstate. at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.UI.Page.DecryptString(String s)
User IP: 74.34.62.187

BaseMessage : Exception genereated on Monday, January 26, 2009, at 2:20 AM
Page location: /ScriptResource.axd?d=y9_dUwBeGqLlRpT5Dml1zhoQvfa7N Kdj69EYuV771kzSsa5KOOXBfJZjk%20%20%20%20%20%20%20% 20%20%20%20%20if%20(cat_gallery%20!=
Requested Url : Buy Garmin GPS Nuvi 350, Nuvi 660, C330 and more at Garmin Factory Outlet Store if (cat_gallery !=
Message: Invalid viewstate.
Source: System.Web
Method: System.String DecryptStringWithIV(System.String, System.Web.Configuration.IVType)
Stack Trace: at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) at System.Web.UI.Page.DecryptString(String s)
User IP: 74.34.62.187
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; .NET CLR 1.1.4322; Zune 3.0)
Jan 26 '09 #1
4 23792
I have been analyzing the data that I have been collecting and I have drawn a few conclusions. I noticed that a large majority of the errors that I have been getting are coming from windows Vista computers running IE 8 or Firefox 3. There where also a few cases where it was Vista and IE 7. This could explain why the errors are now just becoming an issue as more and more people are using the new operating system.



Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; FunWebProducts; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GoogleT5; MSN Optimized;CA; MSN Optimized;CA)
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; GTB5; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Media Center PC 5.0)





But anyways the conclusion that I want to get at is that based on this information I started looking into how the browsers process java scripts and if there was anything new that could be causing this issue, that’s when something interesting pop out at me, I found on the w3School website an article about the difference in html vs. xhtml.



Differences between HTML and XHTML
HTML 4 and XHTML deal different with the content inside scripts:

In HTML 4, the content type is declared as CDATA, which means that entities will not be parsed.
In XHTML, the content type is declared as (#PCDATA), which means that entities will be parsed.
This means that in XHTML, all special characters should be encoded or all content should be wrapped inside a CDATA section.

To ensure that a script parses correctly in an XHTML document, use the following syntax:

So I immediately took a look into my code and I saw that the DOCTYPE directive was missing on some of my pages the sameones that are causing the Issue. I also noticed that where I was outputting JavaScript using the .NET Register Client Script routine it would wrap the inner content of the script tags with the CDATA attribute, while where there was the regular JavaScript written on the page there was no CDATA used. For example



<script language=”javascript”>

Function RunMe() {

}

</script>



I am no expert on how browser’s renders or parse the html return, but I strongly believe it has some thing to do with the situation above because the Url parameter in the Script Resource request whenever it crashes always contains code in between script tags that's below it. Some times there is even html style sheet code that can be found there as well. For example



http://braun.factoryoutletstore.com/...sY8V_8function runSearchForField(eventObj, id){ if ((eventObj.which == 13) || (eventObj.keyCode == 13)) { var cat_gallery = getParam('gallery'); var cat = getParam('cat') var searchTerm = escape(document.getElementById(id).value); // must use escape() function to urlencode search term to avoid issues with '&' and '=' symbols var url; if (cat_







http://braun.factoryoutletstore.com/...5j_0hD8to_aPDj <tr> <td class=





Now what am thinking is that some how because am not specifying any DOCTYPE in the page the browser might be trying to infer based on the data its receiving then it ends up messing up because sometimes there is CDATA and there are times when there is no CDATA present in the page. I don’t know really if this is a solid assumption cause as they say assumptions as dangerous. If anyone can shade some light on my theory and let me know if the browsers are parsing the xhtml differently that older version or even if they had any similar situations.
Feb 3 '09 #2
This has solved my issue
Feb 3 '09 #3
drhowarddrfine
7,435 Expert 4TB
All new web pages are required to use a doctype to conform with current HTML. IE8 will be about 10 years behind in DOM support compared to FF3 and every other browser. I didn't go through everything you posted but that's the jist of things.
Feb 3 '09 #4
cedLeb
1
I"m having the same problem. I verified my pages the doctype is present. So if anyone have an idea on how to resolve this i ll be grateful.
Apr 22 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Andrew Burgher | last post by:
Feeding the following .xsd into the XsdObjectGen (v1.4.2.0) tool produces an invalid attribute: with DataType="System.String". Has anybody seen this behaviour before? Is this a bug in...
0
by: Nazir | last post by:
Hi I've got a strange problem - an aspx page which appears fine on IE 6 W2k, fine on IE 5.5 WinNT, fine on IE 5.0 Win95, but has two problems on IE 4 and some IE 5's (on NT and W2k): -...
0
by: Torrent | last post by:
Has anybody noticed repetitive Invalid Viewstate Exceptions when viewing normal ASP.NET Websites that use the viewstate. I have Default.aspx which is able to be viewed normally and contains a form...
6
by: vinay | last post by:
What is this error?? Exception Details: System.Web.HttpException: Unable to validate data. System.Web.Configuration.MachineKey.GetDecodedData(Byte buf, Byte modifier, Int32 start, Int32...
2
by: Chris Becker | last post by:
I am currently hosting my site with webhost4life.com and my visitors (well, just the visitors that are admins and try to do data entry, modification and removale) are constantly getting "Invalid...
11
by: Nad | last post by:
Hello, I have a page with two link buttons. When I click on the first one I call server.execute("target.aspx") to view target.aspx on the original page. Then I click on the second link button...
0
by: Ian Lane .enizin.net> | last post by:
Hello, I am having a very strange issue regarding our macintosh users running IE. For some reason some users running IE on the Mac are getting an invalid viewstate exception when first coming to...
9
by: Jamie | last post by:
I am receiving an Invalid ViewState error after posting back to the same page twice. Consistently the error occurs after the second postback and not after the first. I have looked into creating...
3
by: steven | last post by:
Hi I've got a client who's getting intermittent errors about invalid viewstate. it happens on random pages. I never get these errors myself. I've already done everything Microsoft recommends to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.