Refactoring: Cheat-Sheet

Please visit my other Object-Oriented Programming articles. Reaping the most benefits from refactoring Use the following quick cheat-sheet when refactoring. Topic Task Remove unhelpful comments Remove comments which state the obvious or replace unfocussed blocks of code with clearly-named methods following the Singe Responsibility Principle (SRP).Remove zombie code – code commented-out to no longer be…

Visual Studio: Code Metrics

Please see my other Miscellaneous articles. Using Visual Studio to guide refactoring Visual Studio provides the following powerful metrics to help guide developers as they seek opportunities for refactoring. To begin the code metrics analyzer, r-click the project -> Analyze and Code Cleanup -> Calculate Code Metrics. You will then be presented with a code hierarchy…

MVC: Passing Query String Values in a View

Please see my other MVC articles. Building Links from Model Data This article illustrates how to build a link within an MVC view which passes model data as a query string variable. First, I begin with my “model” statement exposing my RaveUser model’s properties. Next, I provide an ActionLink() statement with text for the link (“Reload All…

MVC: Parsing a URL

Please see my other MVC articles. Using URL Properties in a page MVC, ASP.NET, and IIS provide a very easy and effective way to interpret data contained within the current URL.By simply creating a method with the appropriately named parameters (order doesn’t matter), that method may parse data contained within the URL.

MVC: Conditionally Display View link

Please see my other MVC articles. Displaying Links Based on IF Logic This article illustrates how to conditionally display a link within an MVC based on the results of an IF statement. As you can see in my View’s HTML, I am displaying a “Home” link and then, if the current user is part of the Administrator…

MVC: Conditional Redirect to View

Please see my other MVC articles. Redirecting Users to a New Page Based on IF Logic Similar to the article (link) MVC: Conditionally Display View link, this article illustrates how to use condition logic to change the user experience by using the controller’s default function to test if the current user is part of the Administrator role,…

MVC: Action Name Attribute

Please see my other MVC articles. Define a Custom Action & URL When a Controller’s Action method is invoked, the URL reflects the name of the method.However, it you need the URL to look different without changing the Action method name, assign an ActionName attribute to that method.First, I’ll begin with a new test Action…

Use HTML Textbox in a Report

Please see my other Telerik report articles. Display Current Windows Username In this article I’ll demonstrate how to display the Windows username of the current user of a report.I’ll start by using the report’s ReportParameter’s editor to add a single Parameter “UserName”. This addition not only is required to display the property in the report,…

Pass Parameters to a Report

Please see my other Telerik report articles. Display Current Windows Username In this article I’ll demonstrate how to display the Windows username of the current user of a report. I’ll start by using the report’s ReportParameter’s editor to add a single Parameter “UserName”. This addition not only is required to display the property in the report, but…

Telerik Reports

Please see my other Business Intelligence articles. Telerik Reports Conditional Background-Partial Cell Conditionally Display Data Customized Layout Display Clickable Links Display Username in Report Filtered Columns Pass Parameters to a Report Reuse Empty Space Multilevel Groups Use HTML Textbox