Asp.net – Invalid postback or callback argument. Event validation is enabled using ‘’

Asp.net – Invalid postback or callback argument. Event validation is enabled using ‘’

This is a common Asp.Net error when updating List Box items on the client side.
I asked this question on stackoverflow.com (Click here).

Just reflecting on how many views people have had on this question, it seems to be a common issue most Asp.Net developers encounter.

Initialising log4net logging for Asp.Net web app

Some snippet below:

protected void Application_Start(object sender, EventArgs e)
{
XmlConfigurator.Configure();

log4net.Repository.ILoggerRepository repo = LogManager.GetRepository();
foreach (log4net.Appender.IAppender appender in repo.GetAppenders())
{
if (appender.Name.CompareTo(“RollingFileAppender”) == 0 && appender is log4net.Appender.RollingFileAppender)
{
var appndr = appender as log4net.Appender.RollingFileAppender;
string logPath = “MyApplication.log”;
appndr.File = logPath;
appndr.ActivateOptions();
}
}

logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

var configSource = new XmlConfigurationSource(ActiveRecordConfigStream);

Assembly assy = typeof([ParentAssembly]).Assembly;
ActiveRecordStarter.Initialize(configSource, assy.GetTypes());

logger.Info(“My Application Starting…”);
}

Using SQL Server CROSS APPLY to read XML segment

Here is an interesting code snippet:

declare @XML xml
set @XML =’


select ExpressionAlias.student_name,
ExpressionAlias.subject_name,
ExpressionAlias.score
From @XML.nodes(‘./students/student’) Student (rowset)
Cross Apply
Student.rowset.nodes(‘./subjects/subject’) Subject (rowset)
Cross Apply (
Select Student.rowset.value(‘@name’,’NVARCHAR(20)’),
Subject.rowset.value(‘@name’,’NVARCHAR(20)’),
Subject.rowset.value(‘@score’,’INTEGER’)
) ExpressionAlias (student_name, subject_name,score)
Order By
ExpressionAlias.student_name ASC,
ExpressionAlias.score DESC;

What the heck is SYLK File?

According to Microsoft:
A SYLK file is a text file that begins with “ID” or “ID_xxxx”, where xxxx is a text string. The first record of a SYLK file is the ID_Number record. When Excel identifies this text at the beginning of a text file, it interprets the file as a SYLK file. Excel tries to convert the file from the SYLK format, but cannot do so because there are no valid SYLK codes after the “ID” characters. Because Excel cannot convert the file, you receive the error message.

I got the error message:
‘SYLK: File format is not valid’
when trying to open a CSV file.

Apparently this is a known issue in Microsoft products.

Read more on KB323626