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…

Dropdown with Custom Date Format

Apply a Custom Date Format to a Dropdown In this article, I’ll demonstrate how to apply a custom format to a date within a dropdown.I’ll begin with a View Model containing my date property. Next, I call my controller action for DataSource.Read() – see my other Telerik articles (link) for an example. The important update…

Telerik: Dropdown Filter on Multiple Columns

Dropdown Filter on Multiple Columns In my Telerik: Dropdown with Template article (link), I demonstrated how to configure a dropdown to display choices with multiple columns. The dropdown provides a powerful and intuitive filter feature which by default allows the user to filter choices based on what they type into the filter textbox. In this…

MVC: Custom Model Validation

Please see my other MVC articles. Using Custom Validation on Model Properties While ASP.NET MVC provides powerful native validation, some requirements require custom routines to ensure certain model data is valid. In this artilce I’ll demonstrate how to configure a model for custom validation and provide a simple example function. First, I’ll decorate the model…