Invalid postback or callback argument. Event validation is enabled using ”

I am getting the following error when I post back a page from the client-side. I have JavaScript code that modifies an asp:ListBox on the client side. How do we fix this? Error details below: Server Error in ‘/XXX’ Application. ——————————————————————————– Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation=”true”/> in configuration … Read more

How to detect Windows 64-bit platform with .NET?

In a .NET 2.0 C# application I use the following code to detect the operating system platform: string os_platform = System.Environment.OSVersion.Platform.ToString(); This returns “Win32NT”. The problem is that it returns “Win32NT” even when running on Windows Vista 64-bit. Is there any other method to know the correct platform (32 or 64 bit)? Note that it should also … Read more

Is there an alternative to string.Replace that is case-insensitive?

I need to search a string and replace all occurrences of %FirstName% and %PolicyAmount% with a value pulled from a database. The problem is the capitalization of FirstName varies. That prevents me from using the String.Replace() method. I’ve seen web pages on the subject that suggest Regex.Replace(strInput, strToken, strReplaceWith, RegexOptions.IgnoreCase); However for some reason when … Read more

XmlSerializer – There was an error reflecting type

Using C# .NET 2.0, I have a composite data class that does have the [Serializable] attribute on it. I am creating an XMLSerializer class and passing that into the constructor: XmlSerializer serializer = new XmlSerializer(typeof(DataClass)); I am getting an exception saying: There was an error reflecting type. Inside the data class there is another composite … Read more