It is very easy when creating a website to fall into the trap of duplicating small bits of information throughout your site. It may seem expedient to hard-code something like your phone number or email in your views, especially initially when you may only reference it in one or two places. However, once you start […]
C#
Adding Custom Namespaces to Razor Views
I’ve recently been working on a new web site using ASP.net MVC5, and I wanted to be able to reference my view models from my Razor views without having to fully qualify their namespace. Since I keep my view models in their own ViewModels namespace, all I needed to do was add that to the […]
Enabling Drag and Drop over a Grid in WPF
Recently I needed to enable drag and drop in a WPF application. The idea was to allow users to drop a file on the application window and the application would automatically open that file. Sounds simple, right? All it should take is to set the AllowDrop property to true on the Grid: <Grid HorizontalAlignment=”Stretch” DockPanel.Dock=”Top” […]
Sending Email on Behalf of Your Users
At HelpEncourage.Me, one of the features is the ability to invite your friends and have them send you helpful advice and encouragement. This means that sometimes I need to send email on your behalf – usually in the form of invitations to join the website or to become a specific user’s friend. In previous posts, […]
Generating a CSS Sprite Image File
One of the common suggestions for improving the speed of your website is to combine all your images into a single image file, or sprite file, and use CSS to display only the specific sprite you want to display. As I start to incorporate a number of icons and other small images into my websites, […]