web 2.0

Custom Configuration Sections FTW

As a .NET developer you will probably create hundred of configuration files over the course of your career. Most of the time when we use a configuration file it is for simple things like a database connection string. However, sometimes configuration data needs to be relational and can require a more complex structure than traditional name value pairs. For example, lets say that I am developing a data import tool which uses the configuration file to store data mapping information. Here is an example of what my configuration file might look  like: <import> <jobs> <job name="Foo"> <fieldMappings> <mapping source="column1" destination="TimeStamp"/> <mapping source="column2" destination="Name"/> </fieldMappings> </job> <job name="Bar"> <fieldMappings> <... [More]

Looking for an MVC Grid Control? Try MVC Contrib!

Like most .NET Web Developers I was ecstatic when MVC was released. To put it plainly, I hate WebForms. However I do find myself missing some of the great WebForm controls like the DataGridView. The DataGridView was present in every WebForm application that I wrote. I really appreciated all the subtle bells and whistles that Microsoft added to the grid over the years. I wrote my own grid control for classic ASP and I know firsthand that it is a significant undertaking to make a grid control that if feature rich and flexible enough to handle complex situations. Therefore I was not crazy about taking on the task again… Initially, I adopted jqGrid as my new de facto grid control. From a end user’s perspective, jqGrid provides a top-notch user experience. Unfortunately, the control is heavily dependent on JavaScript so its not always the best solution for Mobile websites. In addition, jqGrid does require a fair amount of plumbing. Although it’s not difficult to implemen... [More]

Tags: ,

ASPNet | dotNet | MVC

How to Localize an ASP.NET MVC Application

While working on WeBlog this week I decided that I needed to start thinking about localization. If you have never heard the term “localization” before then its just a fancy way of saying that I want my application to be multi-lingual. In order to localize an application in .NET, you generally need to create a separate resource files for each language you want to support. In an ASP.NET MVC application, the resource files should be placed in a folder called App_GlobalResources. The folder can be created by right clicking on your project and selecting Add –> Add ASP.NET Folder –> App_GlobalResources. The resource files follow a naming convention. The first part of the name is the user defined part, for WeBlog we called it “Strings” but it could be whatever you want. The second part of the string is the Culture. For English the culture is “en”, for French the culture is “fr”, and so on and so forth. Here are few examples: Prefix Language Culture ... [More]