Brian Mains

Catch me on linked in at: http://linkedin.com/in/brianmains, or follow me on twitter at: @brianmains.

Browse by Tags

All Tags » MVC (RSS)
ASP.NET MVC JQuery Requests and "using Html.BeginForm()" issues
You may have already experienced this, and I know that I experienced it before, but I experienced it again and forgot about it, and so I figure it would be a good time to blog about it. (When I blog, I remember things better). If you happen to use the...
Posted: Tue, Jun 15 2010 20:36 by bmains | with no comments
Filed under: ,
Unit Testing ASP.NET MVC 2.0 With TypeMock
One of the selling points of ASP.NET MVC 2.0 was the ability to unit test your action methods. Even though Microsoft made MVC flexible by making it easier to unit test than web forms, it isn't always easy to implement without writing a lot of code...
Posted: Tue, May 25 2010 20:50 by bmains | with no comments
Filed under: , ,
Rendering Inline using HTML.Action in MVC 2.0
Html.Action is a method method that injects a response from the server directly into the UI. For instance, a controller can have two action methods, then inject the response directly into the UI from the other controller. Take a look at the sample form...
Posted: Sun, Apr 25 2010 13:32 by bmains | with 1 comment(s)
Filed under: , ,
Intro to Telerik MVC's DatePicker Control
The freely available ASP.NET MVC framework by Telerik has added a new DatePicker control that works similarly to the RadDatePicker control in its ASP.NET AJAX framework. Below is a sample of that control: <% Html.Telerik().DatePicker().Name("Picker"...
Posted: Sat, Apr 10 2010 14:22 by bmains | with 5 comment(s)
Filed under: , ,
Telerik Calendar Control Intro for ASP.NET MVC
The latest release of the open source Telerik ASP.NET MVC framework contains a new calendar control. This control functions similar to the ASP.NET AJAX calendar extender calendar, where it shows a month view, year view, and decade view, and responds to...
Posted: Thu, Apr 8 2010 22:19 by bmains | with 1 comment(s)
Filed under: , ,
Generated ID's from Model Binding
With the new various For methods in MVC (DisplayFor, TextBoxFor, etc.), these methods use a lambda to specify the fields to display/render. The following form below: <% Html.BeginForm(); %> <%= Html.ValidationSummary("The following errors...
Posted: Fri, Apr 2 2010 20:43 by bmains | with no comments
Filed under: ,
Client-Side Validation Updates in MVC 2
Not only does MVC support server-side validation, client-side validation is a possibility too. Below is a sample form that sets up validation using client-side javascript. These client-side features are made available from the MicrosoftMvcValidation.js...
Posted: Mon, Mar 29 2010 17:56 by bmains | with 2 comment(s)
Filed under: ,
Error with Client Validation
We are about to talk about client validation soon, but if you already know about it, read on; if not, wait until my next post and come back to this one :-). I'm writing this now because I just found it. If you use client validation, it's important...
Posted: Fri, Mar 26 2010 21:32 by bmains | with no comments
Filed under: ,
Server Side Validation Updates in MVC 2
ASP.NET MVC 1 had features built in that allowed you to validate content on the server-side, by specifying the elements to listen to validations for. These features have been enhanced so that you can use a lambda to specify the field to validate. Below...
Posted: Fri, Mar 26 2010 20:50 by bmains | with no comments
Filed under: ,
Input Validation in MVC (1 and 2)
In ASP.NET web forms, anytime an element within the form post contains an HTML tag (such as a <div> or any other tag), the input that's posted back to the server is validated, and an exception thrown, if that post contains any HTML tags within...
Posted: Fri, Mar 19 2010 19:13 by bmains | with 1 comment(s)
Filed under: ,
New Data Display Options in MVC 2
ASP.NET MVC 2 has provided a lot more options for displaying the data to the end user within your views. Here are a few of the options you have: Html.DisplayFor(i => i.FirstName) - DisplayFor renders the value of a property directly to the browser...
Posted: Thu, Mar 18 2010 11:45 by bmains | with 3 comment(s)
Filed under: ,
New Attributes in ASP.NET MVC 2
You may or may not have heard that ASP.NET MVC 2 has been released not too long ago. There are quite a few changes that come with ASP.NET MVC 2. In this article, I'm going to talk about some of the attribute changes related to MVC 2 now available...
Posted: Thu, Mar 18 2010 11:40 by bmains | with no comments
Filed under: ,
Fluent design in MVC
Like web forms, MVC allows you to customize the building blocks for developing in MVC. Extension helpers are so easy to write because all it takes is an extension method like the following: public static class MyExtensions { public static string CustomHiddenField...
Posted: Fri, Jan 8 2010 20:54 by bmains | with no comments
Filed under: ,
Using the Telerik MVC Grid
The Telerik MVC grid that comes with Telerik's MVC open source framework is awesome. It really rocks; it has a lot of the features that exists within the ASP.NET AJAX framework are also in this grid implementation. Not only that, it implements MVC...
Posted: Mon, Jan 4 2010 19:05 by bmains | with 5 comment(s)
Filed under: , ,
Customizing the Controller Capabilities in ASP.NET MVC
ASP.NET MVC gives you a lot of options when you want to customize the way that ASP.NET MVC uses controllers. By default, ASP.NET uses a controller factory to handle MVC controller requests. A ControllerActionInvoker class, related to the controller, is...
Posted: Mon, Dec 14 2009 6:15 by bmains | with no comments
Filed under: ,
Location Formats in ASP.NET MVC
ASP.NET MVC is a wonderful thing. One of the many great features is the ability to customize all of the .NET framework's code by swapping out one implementation and using another. One such instance is creating a custom view engine, which you can do...
Posted: Mon, Nov 16 2009 19:49 by bmains | with no comments
Filed under: ,
Telerik's Compressing and Combining Scripts in MVC
The latest Telerik MVC set of components features a ScriptRegistrar component that's responsible for compressing or combining scripts into a single file. This compression utility is very easy to implement: to setup this component, use the following...
Posted: Tue, Nov 10 2009 20:50 by bmains | with no comments
Filed under: ,
Working with Web Forms and MVC: Bridging the Gap - Context
I've spent some time figuring out how to bridge the gap between web forms and ASP.NET MVC style of development. Just because the UI works differently, doesn't mean the actual framework works in a different way. If you use .NET 3.5 SP 1 for both...
Posted: Sat, Nov 7 2009 11:02 by bmains | with 2 comment(s)
Filed under: ,
MVC Controller Context - Where does it come from?
The Controller class maintains a reference to the HttpContext property, and object of HttpContextBase. HttpContextBase is a great class because now we have an abstract way to replace default logic if needed (but generally that wouldn't be recommended...
Posted: Sat, Sep 12 2009 23:03 by bmains | with no comments
Filed under: ,