Monthly Archive: December 2008


HttpPostedFile.FileName browser dependent behaviour

Even though these kind of variables must have some standards (may be it already has), there are differences in practise. Be careful with the FileName property of HttpPostedFile class when you want to work on a file being uploaded by visitors of your page because the FileName value that you will get on Internet Explorer and Firefox are different. If...


Extension methods don’t compile? No panic!

I came across to a really strange problem today. Some extension methods that I have copied from another project just did not want to be compiled at all. ‘string’ does not contain a definition for ‘MethodName’. I have checked everything, including clearing the temporary ASP.NET files within framework folder (C:\Windows\Microsoft.NET\Framework\…), restarting Visual Studio and even restarting the OS. The target...


Some useful UpdatePanel extensions

I want to share some pretty basic and useful UpdatePanel control extensions with you. Method names are self explaining so I will not go deep in details. public static void AlertOnLoad(this UpdatePanel updatePanel, string key, string message) { message = message.Replace(“‘”, “\'”).Replace(“\r\n”, “”).Replace(“\n”, “”); message = “alert(‘” + message + “‘);”; AjaxControlToolkit.ToolkitScriptManager.RegisterStartupScript(updatePanel, updatePanel.GetType(), key, message, true); } public static void...