Bundle javascripts safely in ASP.NET MVC 01 April 2014 Jeff ASP.NET, MVC, C# Problem: The other day I spent a lot of time to figure out that why my web application didn’t work correctly is because of the ASP.NET MVC default JavaScript bundle renamed the function name of Canva... [More]
Replace Telerik window with jquery-ui dialog 28 February 2014 Jeff ASP.NET, C#, JavaScript When you need to display some information via pop up window, it's better to use jquery-ui dialog than Telerik window. Not only because the Telerik is not supported any more, but also because the jquer... [More]
ASP.NET MVC: Why can’t compressing stream and whitespace removing stream work together? 02 September 2013 Jeff C#, MVC Problem: The other day, I wanted to employ some ActionFilterAttributes to totally compress my dynamically generated HTML before sending it to the client for network bandwidth saving and so improving t... [More]
How to make tracing log local system date time in tracing (C#) 23 July 2013 Jeff C# Background: You have a C# application, and you have enabled the tracing feature. Now you want to the tracing log to contain the local system date time along with the log entries. Analysis: Enable d... [More]
Resolved: Unable to open configSource file when debugging a program 11 July 2013 Jeff C# Problem: When debugging a program, met an error: Unable to open configSource file. Cause: The program conigures the trace listeners outside of the App.Config in a separate configuration file, and spe... [More]
使用静态类的构造函数,保证某些操作在整个程序运行过程中只运行一次 26 June 2013 Jeff C#, Programming 编程 问题: 有一些初始化操作,需要在整个程序运行过程中,只运行一次。除了使用单例模式,或者在 Main() 中实现,还有其他方法么? 比如,有一个任务处理程序,每次点击Run按钮,程序就会调用一个静态类StepsProcessor.cs中的ProcessSteps()方法依次对指定的任务列表进行处理。这个静态类会发布三个事件: 开始执行任务列表 全部任务执行成功 某个任务执... [More]
C#: Get a random string 24 December 2012 Jeff C# Background: Sometimes, we need to generate some random strings for testing purpose. When I met this situation, I was surprised that C# has no such built-in methods inside its Random Class. So I had t... [More]
How to iterate through all the properties of a class in C# 12 September 2012 Jeff C# How to iterate through all the properties of a class in C#? Use Reflection. And there are some differences between iterating through a instance of a class and iterating through a static class. Here a... [More]
Batch operates all the elements in an array 01 August 2012 Jeff C# Problem: You have an array consists of a series of numbers, and you want to have all the numbers subtract 1 by themselves. Solution: Use <object>.Select() extension method provided by System.... [More]
An extension for C# built-in Random class 29 July 2012 Jeff C# For testing purpose, I need to generate some random string (contains only letters without any other special characters) with customized length. So I extends the C# built-in Random class like this: #r... [More]