Fixing dotless @import Fast!

Working in a project I had a problem when using @import with my files .less together with dotless and the LessTransform. I search in the Web and found some solutions but that didn’t work because I had some build errors. So I decide explore the Less.Parse and found the DotLessConfiguration, and did a really easy (3 steps) solution since I knew my folder path (/Content). See below.

Continuar lendo “Fixing dotless @import Fast!”

Anúncios
Fixing dotless @import Fast!

Globalizing Javascript with .NET Resources Using ASP.NET MVC

Sometimes you already have a .NET Resources to translate your application and now you need to use the same messages in Javascript. In this post I will show you how to create an ASP.NET MVC action and return a javascript object containing the messages, all that respecting the culture setted in the Thread.CurrentUICulture.

Continuar lendo “Globalizing Javascript with .NET Resources Using ASP.NET MVC”

Globalizing Javascript with .NET Resources Using ASP.NET MVC

Share ASP.NET MVC UserControls in a ClassLibrary

Share ASP.NET MVC UserControls in a ClassLibrary is not an obvious task to do. We need to make some registration in the HostingEnvironment and create some classes to search for the file in the shared assembly. This post will explain how to do it step by step, this question was asked in the StackOverflow and you can see my answer here.

Continuar lendo “Share ASP.NET MVC UserControls in a ClassLibrary”

Share ASP.NET MVC UserControls in a ClassLibrary

ASP.NET MVC: Client Validation for Custom Attributes

In this post I´ll explain how to validate your custom attributes in the client side. There are two ways to do it, one is when your attribute is inheriting from RequiredAttribute, RegularExpressionAttribute, etc, and the other is when your custom attribute is completely new.

Continuar lendo “ASP.NET MVC: Client Validation for Custom Attributes”

ASP.NET MVC: Client Validation for Custom Attributes

Globalizing DateTime and Decimal in ASP.NET MVC Using ModelBinder

If you already develop an ASP.NET MVC application in your computer that has some specific culture, pt-BR in my case, and after you publish to a server that has a different one, Azure using en-US in my case, you will have some unexpected results when typing date and decimal values. In this post I will show how to have sure that your application will work as expected in any server. We will accept values corresponding to the culture chosen by the user.

Continuar lendo “Globalizing DateTime and Decimal in ASP.NET MVC Using ModelBinder”

Globalizing DateTime and Decimal in ASP.NET MVC Using ModelBinder

Creating Javascript Proxy to Call ASP.NET MVC Controller Action

One of the most used routine when developing a WEB application is calling an action using jQuery AJAX. This post will show you how to make this task easier and more natural in the format SomeController.SomeAction(parameters).

Continuar lendo “Creating Javascript Proxy to Call ASP.NET MVC Controller Action”

Creating Javascript Proxy to Call ASP.NET MVC Controller Action

Customizing ASP.NET MVC to Serialize Json DateTime in a More Natural Way

If you develop with ASP.NET MVC and use the JsonResult in response from an AJAX call, already had the problem that the DateTime is serilized in the format /Date(Ticks)/. this happens because the JsonResult uses JavaScriptSerializer to serialize the object.

Continuar lendo “Customizing ASP.NET MVC to Serialize Json DateTime in a More Natural Way”

Customizing ASP.NET MVC to Serialize Json DateTime in a More Natural Way