By John Bubriski on February 22, 2012
Here is a post I wanted to write a few months ago while I was actively developing Kentico based websites, but I never got the chance to finish it. The code should be solid, and I’ll explain it as best I can. If you’re working with BizForm’s programmatically you’re going to need to get the ID [...]
Posted in Kentico, Programming | Tagged .NET Framework, ASP.NET, C#, Code, Kentico API Programming, Kentico BizForms, Kentico CMS |
By John Bubriski on February 21, 2012
Need to get all the files contained in a directory, recursively searching through sub directories? No problem! Here is how to do it without writing your own recursive function: var fileNames = Directory.GetFiles(directoryName, "*.*", SearchOption.AllDirectories); That’s it! No explicit recusrion required! If you want to do searching where you can stop when a given file [...]
Posted in Programming | Tagged .NET Framework, C#, Code, Files and I/O |
By John Bubriski on February 15, 2012
This isn’t my normal type of “full” post. Rather, I wanted to plug my own project which attempts to “standardize” the way people do Symmetric Encryption in .NET using the AES algorithm (the successor to Rijndael). It’s called Encryptamajig. To quote the project readme: “When you look at encryption examples online many are verbose, misleading, [...]
Posted in Programming | Tagged .NET Framework, AES, C#, Cryptography, Decryption, Encryption, Rijndael, Symmetric Encryption |
By John Bubriski on November 9, 2011
If you’ve worked on an ASP.NET MVC site, you may have had to reference the ID in the current route. In a Razor view you can reference it via the following variable: @Url.ViewContext.RouteData.Values["id"] You may use this a lot if you have a lot of inter-action navigation. Why not throw it into an extension method!? [...]
Posted in Programming | Tagged .NET Framework, ASP.NET, ASP.NET MVC, C#, Code, Extension Method |
By John Bubriski on October 17, 2011
Ever need to inject some custom validation into a BizForm? Check it: Below I’ve provided a method you can drop into your BizForm code behind, or the code behind of a BizForm clone. Then, call this method from an event handle for the OnBeforeValidate event. If Field A has a value this validation method forces [...]
Posted in Kentico, Programming | Tagged .NET Framework, ASP.NET, C#, Code, Kentico API Programming, Kentico BizForms, Kentico CMS |
By John Bubriski on April 19, 2011
In this article I’ll show you how to create a special type of BizForm that will allow each user to edit their specific form data over and over. When a user returns to a page that has the BizForm on it, their data will be automatically loaded from the BizForm table. This is a simple and easy way to store per user data, without mucking with the System Tables which aren’t intended to store this type of data. You also retain the benefits that a BizForm has over a System Table (A view of the data, Notifications, attachments, etc.)[...]
Posted in Kentico, Programming | Tagged .NET Framework, ASP.NET, C#, Code, Kentico API Programming, Kentico BizForms, Kentico CMS |
By John Bubriski on December 3, 2010
Kentico is great but nobody is perfect! One small detail they’ve missed is a checkbox control that you can set to be “required”. By required I mean “You have to check this box”. After doing some Googling, I found this thread which confirmed my suspicion: http://devnet.kentico.com/Forums/f45/t17269/Making-a-Required-CheckBox-in-Alternative-Form.aspx?replyto=17359 “We have validators for empty values, which means that [...]
Posted in Kentico, Programming | Tagged .NET Framework, ASP.NET, C#, Code, Kentico API Programming, Kentico CMS |
By John Bubriski on October 25, 2010
If you ever do something like this… try { // Some potentially dangerous code } catch (Exception ex) { // Do nothing and swallow the exception } …DON’T. There is never a good reason to do this! If you have this code in a Class Library the problem is magnified! Doing this makes it hard [...]
Posted in Programming | Tagged .NET Framework, ASP.NET, C#, Code, Elmah, Exceptions, Kentico API Programming, Try/Catch |
By John Bubriski on October 18, 2010
So recently I’ve created a couple useful code snippets, and here they are for you to download! Download My Code Snippets To use them, just place them in your custom code snippets directory, which will be something like: C:\Users\{username}\Documents\Visual Studio 2010\Code Snippets Here are the snippets that are included in the zip file download: C# [...]
Posted in Programming | Tagged .NET Framework, ASP.NET, C#, Code, Code Snippet, jQuery, SQL, Visual Studio |
By John Bubriski on October 11, 2010
Introduction I’m a regular developer like you, foraying into the world of embedded programming. Here is how I got started with the Netduino and some solutions to the issues I’ve dealt with. Where To Start? First off, if you haven’t already, check out the Getting Started guide on the Netduino site. This a basic tutorial [...]
Posted in Hardware, Programming | Tagged .Net Micro Framework, C#, Code, Embedded Programming, Netduino, Visual Studio |