Quick Tips

February 24, 2017

Take Control of Code Coverage Analysis with Exclusions

As developers Unit Testing makes our jobs easier, we have consistent tests to validate our work, change management becomes easier, and we can prove the functionality remains the same. In collaboration with various companies, however, I find that often the tooling gets in the way of developers understanding exactly how much of their important code is covered by unit tests. Visual Studio provides unit test coverage tools for reporting, yet often the tool ends up discouraging users due to a lower than expected rate of coverage. In this post, we will investigate a few common areas that can impact your unit test coverage, and how to prevent certain items from changing the reported coverage percentage.

September 24, 2016

Properly Using DNN's Custom 404 Page

Recent issues with a few clients I have encountered some "unusual" behaviors.  Either a situation where we had an unusual redirect situation, or we had pages that were showing HTTP 200 (success) status responses when in all reality the page truly didn't exist.  In the end, we had an IIS customization configured to handle certain types of 404's that DNN wouldn't handle, such as those for missing images, javascript files, and more.  Nothing that we haven't done for quite a while.
September 07, 2016

Date Fields, ASP.NET MVC, HTML5, and Web Browsers

Life as a developer with our current tools is quite amazing.  Even those of us without any real "creative" side can build applications that look nice, that accept user inputs nicely and provide a decent user experience.  The one downside to these features is the different times where we can be tricked by the tools and trying to track an issue down will result in needing to dig deep to find the "right" solution for the situation at hand.  In this case I'll share a quick tip with dates & MVC and HTML5.

July 15, 2016

Being a Good DNN Citizen: Referencing Database Tables

For quite a while now I have written about development best practices, methods to improve the performance of developed solutions, and a little about how to be a good citizen with other portions of the application.  In this post I will take a look at a few standard situations that I have encountered when working with developers new to the DNN Platform.  

July 14, 2016

Avoiding Unexpected Bundling Issues with ASP.NET MVC

One of the most commonly overlooked tasks that I find when working with development groups is the act of Bundling and Minification of CSS and JS resources. There are many solutions to accomplish this task and various developers will have their own preferred frameworks.  I personally find that the features provided by ASP.NET meet many of my needs quite well, however, there is one common gotcha that can impact production deployments that might not get fully tested.  This post is not specifically about HOW to bundle with ASP.NET, but is more around how to prevent unexpected issues in production.

January 16, 2016

Preparing for Load Balancing Diagnostics a Retrospective

As web application become more complex, or as individuals demand better performance or reliability, the addition of more web nodes is very common.  For those with a technical background we can easily see the complexity that is introduced as we load balance our applications.  Simple tasks such as writing a file to the local file system have now become far more complicated tasks.  How are the servers getting their content?  Shared file system?  File Replication? (DFS, RoboCopy, etc.)  When things work beautifully, it is great, but when they don't it can be a nightmare.  In this post I want to share a few "lessons learned" as it relates to load balancing diagnostics.  The information contained in this post is specifically related to working within a DNN Installation, however, the same principals will apply regardless of the platform.

December 29, 2015

Debugging & Managing NuGet Packages A Lesson Learned

Over the past few years those of us in the .NET development space have been forced to jump on the NuGet bandwagon as it relates to adding certain dependencies to our own projects.  No matter what our individual thoughts are with regards to NuGet we must learn to live with the tool, and use it to the best of our abilities.  Most of the time the packages that we use will be well-formed and managed in a responsive manner.  However, as I recently learned, that isn't always the case.  When things start to go awry it can make your standard diagnostic processes less than successful.  Given these experiences I wanted to share two recent experiences with NuGet, not in an effort to shame any of the involved parties, but to help illustrate the importance of looking at solutions & packages in a different light than your standard development processes.

November 20, 2015

Check Your DNN Configuration for Performance!

More than six years ago I created the first version of my  DNN Performance Best Practices guide.  This guide has been downloaded by thousands of people looking to get the best performance out of their DNN installations.  The guide has been the training tool I've used for new members of my staff, and it serves as the baseline for any new DNN installation that we work with.  However, in this post I want to draw attention to what has recently become a silent killer with regards to DNN performance.  

September 23, 2015

Fixing Failing DNN Scheduler DNN 7.3.x Issues

In the past few months I have had to work with various issues with DNN/Evoq sites not executing scheduler jobs.  A number of various blog posts as well as forum posts have been started on the issue, and all point to a similar issue with regards to case-sensitivity with the scheduler and the web server name.  I had a recent situation though where I had fixed all of the issues outlined but was still seeing an error.

September 08, 2015

Avoiding Issues with DNN EncryptParameter

Working with DNN extension development we often need to share information from page-to-page or other locations within our application and we want to do so in a secure manner.  For the longest time DNN has contained a handy set of methods in the UrlUtils namespace, EncryptParameter and DecryptParameter.  They are easy to use, but just recently I have uncovered a very unusual situation that resulted in an error.  Funnily enough, this code has been running in production for more than 5 years!

August 25, 2015

ASP.NET MVC 5 & Bootstrap 3 Validation Usage

There have been many posts out there that show various solutions to use ASP.NET MVC 5 with Bootstrap 3 style input validation.  Some of the solutions are far better than others, and others looked perfectly elegant, yet they didn't necessarily result in changes working the way that one would expect.   After trying multiple solutions I found that I was able to take one of the more elegant solutions and it was working for "success" but wasn't working for error states, so I decided to dive in an fix it for my situation.

August 11, 2015

Determining Database & Table Sizes in SQL Azure

As the popularity of Microsoft's Azure platform continues to rise, I find myself constantly adding new scripts to my library.  As technology continues to evolve we need to find different solutions to meet technology needs.  SQL Azure has introduced a number of changes to processes and protocols as it relates to development & support.  One of the most viewed topics on this blog is my Determining SQL Server Table Size, a quick post from 2007 after helping a co-worker solve a problem.  Fast forward 8 years and this post still sees more than 1,000 views in a month.  However, try to run that on SQL Azure and you will have an issue.  SP_SpaceUsed is not available to us on that platform!  In this post I will provide a few helpful queries to get around this limitation.

December 15, 2014

DNN Quick Tip: Ajax Postback Controls

In an effort to get more regular content out here to the blog I am going to try and resume my "Quick Tips" posts.  These are much shorter posts than some of the more involved ones that I do, but cover common questions and tips that I get via email.  A very common request that I get from developers after they have set the "SupportsPartialRendering" flag within their module manifest is how can they set a control to force a postback quickly & easily.  Lets investigate!
December 15, 2014

Vendor API Integrations: Developer Beware

Since I started IowaComputerGurus in early 2006 I have worked on more than 100 different vendor API integrations.  Now two integrations have been the same, even if they are both going to the same vendor API.  Each integration project is a unique beast, the business requirements however similar are exactly that, similar.  The small changes, the small tweaks that you might have from one client to another on the same platform can be catastrophic.  Having done so many of these, I thought I had seen it all, from poor API's, to poor support, and everything in-between I could go on for days with the things I've experienced over the years.  However, after two recent experiences, by far the most horrible I've ever experienced I thought I'd share a few lessons learned to help others out there learn from my experience over the last 4-6 months.
November 03, 2014

Back to the Basics: LINQ and You

This past weekend I was a presenter at IowaCodeCamp, my favorite local .NET event each spring/fall.  My session this year was "Back to the Basics: LINQ and You" and it was much more popular than anticipated!  After spending a lot of time training development teams over the past year I found that although LINQ has been available since 2008 many individuals have either not yet had the chance to use it yet in their projects or those that are using it still didn't fully understand how/why it works the way that it does, and thus my session was born!
September 12, 2014

Understanding the Logistics of Moving Websites

Recently for a number of reasons I've been working with individuals that are taking a website and moving them from one hosting provider to another.  Sometimes these moves are taking the existing site as is, other times it is migrating to a "new site" at the same time.  However, after doing at least 10-12 of these in the past few months a few common points of "confusion" have come to light.  As such, due to popular request I'll lay out the basics of how to move a website from one hosting provider to another and discuss the component parts that are involved in such a move. Although a bit "off" from my normal development or performance topics this is still a very real thing for many people!

April 11, 2014

Avoiding Performance Issues with Multi-Portal DNN

In the first 3 months of 2014 I have encountered multiple multi-portal DNN installations that have been suffering from severe performance issues.  In most cases these users had already followed the whitepaper recommendations that I have had published since early 2007 and the sites were still slowing to a crawl at best.  Digging in, each time I found that a single fundamental issue was the root cause, with a few other secondary considerations.  Given the popularity of DNN continuing to grow and the relative ease of Multi-portal configurations I though it would be important to share.
September 24, 2012

Creating Custom DotNetNuke Module Categories

As part of one of the recent overhauls of the DotNetNuke interface the control panel was updated to include a "Category" selection that allows modules to be grouped logically into categories.  Out of the box a total of two categories are created "Admin" and "Common" with only the Text/HTML module included in the "Common" category.  In this posting I'll take a deeper look into this functionality and how you can create your own categories, and how to move modules around between categories to make administration even easier!
July 06, 2012

Creating Simple Re-Usable Confirmations in DotNetNuke Skins

As part of the IowaComputerGurus site redesign that I just launched earlier this evening I was looking for a simple "no hassle" way to add a confirmation to a link before downloading. Historically I created a module to manage this and the module managed those links. However, I wanted to find something more flexible so that I can put my download links wherever I want, in any Text/HTML module, on any section of the site. Amazingly I was able to do this with two lines of JavaScript in my skin file!

July 05, 2012

Security Exceptions After Moving .NET 2.0 DNN Site?

Over the past few weeks it seems that I have been doing more DotNetNuke site shuffles than I have in a long time.  From local -> production, from hosting provider a -> hosting provider b, and any combination therein.  This process is practically second nature for me as I've done it so many times.  However I had two sties that proved to be really troublesome so I though I'd share the root causes here in hopes that it might help someone!
June 26, 2012

Taking Control of the DotNetNuke WYSIWYG Editor

DotNetNuke by default uses the Telerik RadEditor as the rich text editor. It is a truly amazing product and one of the better WYSIWYG editors. Just like any editor though it does have some mannerisms that are not so welcomed by users. A little known fact within DotNetNuke is that you have a number of configuration elements available to help not only make the editor easier to use by removing un-needed items, but you can drastically improve functionality for super-users if so inclined and prevent issues when staging content etc. In this post I'll dive into a few of the key configuration items that I make to all new sites.

June 23, 2012

Using radCaptcha Via DotNetNuke Wrappers

When putting a form that is public facing we often need to add a captcha to help prevent bots from submitting our forms.  Historically there has been a control available within DotNetNuke that worked for this, but admittedly it didn't have the best customization nor was it the most "pretty" of them out there.  Ever since DotNetNuke has had the Telerik Controls a new option has been available yet its usage isn't the most widely documented.  In this post I'll show you how to use RadCaptcha in your own custom modules.
June 15, 2012

Windows Azure 90 Day Free Trial - Buyer Beware!

This is just a quick public service announcement for those that might be looking at trying the new Windows Azure service for hosting a DotNetNuke site.  I have been working with a few people that have been wanting to try it out and overall the experience has been pretty good as the DNN install was successful and performed quite well.  However, the reason for this post is a warning to those of you that are working within the "free trial" period.
January 23, 2012

Simple Zip Code to Zip Code Distance Calculations with SQL Server

Over the years I have implemented a number of various "near me" style searches using third-party zip code databases and a long, complicated formula to find the distance between two different latitudes and longitudes.  Well, starting with SQL Server 2008, it is possible to get the same result, with a lot less effort, following two simple steps.  In this post I will walk through things step by step.
January 22, 2012

DotNetNuke 6.x Text Editor Upgrade Issues

In the past 2-3 weeks I have been working on upgrading the DotNetNuke Installations on both this website and the IowaComputerGurus website and finally I can say I'm done with the upgrades.  These sites, although not that complex had a number of issues with the upgrades, some of which I have blogged about in the past, and then today a brand new oddity was discovered.  After upgrading the site everything was functional, however the text editors were behaving very unusually.  Clicking "Save" at times would not redirect you back to the page, but content would be saved.  Other times it would redirect you back to the page, but your changes were not saved.  I couldn't find any rhyme or reason behind it, so I started digging.
December 19, 2011

Getting Up to Speed on DNN 6.x Design

So like many developers I have been spending some time recently updating my client, commercial, and open-source modules to support the new DotNetNuke 6 Form Pattern from a design perspective, to make my modules better integrate into the system.  Looking around when I was starting there is very little "true" documentation on this concept, and for me it was a bit cumbersome pulling everything together.  I started with this Wiki Article and then ended up spending a lot of time digging/inspecting lots of other modules that had been upgraded.  So in this post, I'm going to take a bit more of a 'code-centric" no-nonsense approach to what your form should really look like, I hope that this helps you.

November 07, 2011

Force User Roles Update via DotNetNuke

One of the things that I have been finding that I do a lot recently is updating user security roles based on actions either taken by the users or actions that have been taken by others.  Doing so is quite simple from a DotNetNuke API perspective but how do you go about actually forcing the role membership change right away?  That is what I'll talk about in this post.

October 07, 2011

Securing a DotNetNuke Installation - Passwords

A while back I released a tool called Secure My Install that was designed to help people take existing DotNetNuke sites and change the way that they store passwords to use a more secure process.  Many people have used that module successfully to convert their sites, however, I never took the time to share the few small steps that are needed to simply "secure" your site as soon as you set it up so that you can avoid all of the hassle in the beginning.  In this post I'll walk through the simple process of changing your configuration to go from Encrypted Passwords to Hashed passwords and a bit of detail as to "why" you want to make the change.

August 12, 2011

Improving the C# Debugging Experience - DebuggerDisplay

In an effort to start blogging more about the "helpful" items that I have encountered over the years this is one of my first "Quick Tips" related to improving the life of the developer.  We all have had those times where we are tracking down a complex problem within an application and all along the way we have to spend endless time mousing over individual classes to find out what their values are when most commonly we just want to know about one or two key values.  Well in this post, I'll show you a neat trick using the "DebuggerDisplay" attribute to help make this process easier.

July 07, 2011

Auto Packaging Multiple Modules with DotNetNuke

Like many people I have been building DotNetNuke Modules using Chris Hammond's DotNetNuke Module Template.  It is a great template set and works well in 99.9% of cases.  However, recently I have been building more and more complex module solutions for customers where within a single project I have a need to package up two or more "distinct" modules.  Therefore I have one DotNetNuke Module Manifest and it will install multiple modules.  Overall the process works great, but there is one small nuance, the filename, if you have two modules you will get xx.xx.xx.yy.yy.yy as the filename, which is the version of module 1, and the version of module two.  In my case I just want the first module to show, and in this post I'll show you how.

July 07, 2011

Resolving Recurring DotNetNuke Scheduler Errors

One thing that can kill a DotNetNuke quite quickly is a module that goes "rogue" and starts throwing regular errors in the scheduler.  This is especially the case when it comes to a module that might be heavily used.  Not only do you just have the fact that you are having errors, but you also have the issues around the fact that you can't find TRUE errors in the log.  In a world long ago, back in the DNN 4.4 - 4.8.x days there used to be an issue with certain modules that has apparently started to rear its ugly little head again and I'm not sure why.  In this post I'll investigate this specific error type.

April 18, 2011

Causing a Specific Control to Postback

I was recently debugging an issue with a form where the user wanted the "enter" button when pressed in a textbox to trigger a specific ASP.NET button to postback to the server.  I have done similar things in the past with a method that changes for the pressing of Character 13 which is the enter key, then finding the button by id and then continuing on.  Well recently I found out that depending on the structure you can still get some "interesting" results.  So I went looking for a different method, and came up with the following.

April 17, 2011

Modfying WPF Textbox or Other Control Behavior

So as I have mentioned in previous blog postings and on Twitter, I have been working a lot more recently in WPF than in recent months due to a big project I had been completing. One of the final "Client Review" items that I had to resolve was that they didn't like the way that the textboxes worked. The default behavior for textboxes in WPF when tabbing into them was to put the cursor at the beginning of the field. I agree that the usability was not good, but I had over 400 textboxes and didn't want to have to change all of them. SO I went digging for a solution....

January 12, 2011

Improving Visual Studio 2010 Performance on Win XP

At my "day job" I have the pleasure of working with Visual Studio 2010 on a Windows XP laptop with only 2Gb of RAM.  For those of you that follow me on twitter, you might have noticed a series of frustration tweets awhile back when Visual Studio was crashing on me between three and ten times per day.  With the recommendation of a Microsoft Visual Studio team member we have found a way to resolve the issue. You can find the full details inside the full posting.

January 04, 2011

C# Quick Tip: Try/Finally Block

This post is the first of a series of "quick tip" blog postings.  These will be shorter articles focused on providing quick tips on various topics.  Each posting will be tagged with a single category as well as the "Quick Tips" category to indicate it is a quick tip.

For the first Quick Tip I want to focus on a language feature of both C# and VB.NET that is not always something people think of.  Everyone should be familiar with the Try/Catch/Finally and Try/Catch blocks of code.  These are key concepts that are discussed in introduction to .NET classes.  However, there is another flavor of exception handling that can be used which is a Try/Finally block. In this post I will show a simple example.

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Content Copyright

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.