Archive for April, 2011

Replace Notepad with Notepad2

Notepad2 launches instantly, just like Notepad but it has tabbing and line wrap…it even has code syntax highlighting for all the major languages and scripts.  Download the Setup for version 4.2.25 (or higher) and it will replace all calls to Notepad with Notepad2 (e.g. typing “notepad” in Run launches Notepad2).

Replace MS Paint with Paint.NET

Paint.NET is a free app built on the .NET platform that has way more features than MS Paint but opens just as fast.  Paint.NET doesn’t have as many artistic tools that Gimp or Photoshop has, but 99.9% of the time I just want to quickly crop a screenshot and add some red circles and arrows for emphasis.  With Paint.NET, I can change the tool default to rectangle selection, brush to arrow, font size to 14, etc, so as soon as I start the app, I can start cropping an image…instead of drawing a black line across it.  This is my new favorite free app (right next to 7-Zip), in fact I deleted MS Paint from my box and replaced it with this.  Here’s where you can download it:

To set your default tools, brushes, etc, open the Tool dropdown on the menu and click the “Choose defaults…” option:


How to POST model if GET action has parameter in ASP.NET MVC

Do you have a post action that accepts a parameter (and what post action doesn’t?), but you also have a get action that accepts a parameter and you are seeing that submits are going back to the get action and other strange behavior? Here’s how you fix that:

View full article »

Download a complete solution for this article here

Using ASP.NET MVC 3 and jquery, we can easily and automatically validate and format data such as phone numbers and social security numbers into user friendly formats like (xxx) xxx-xxxx or xxx-xx-xxxx, not only when data is presented to the user, but also while the user is typing in data! We can also block the user from even entering non-numeric characters if we wish. We can parse that data after a form submit and strip out the parentheses and dashes before it reaches the controller action. We can also easily control the appearance of the input textboxes of all the fields in all the forms in one easily modified location. What’s nice about the approach presented here is that the developer only needs to designate a model field as a social security or phone number in one location (the view model) and the system handles all the html, jquery, and data cleanup automagically. This is done without using the class html attribute on any of the input controls, which frees the developer to use css classes as normal. Furthermore, this approach is compatible with Microsoft’s jquery unobtrusive client-side validation, so you can present the user with friendly highlighting and popups before invalid data is even sent to the server.  Put together, these techniques create a crisp, fluid experience for the users and a fast, easy development environment for the developers.

View full article »

© 2018 Robert Corvus