WebLog Posts in Category MVC
Rendering ASP.NET MVC Views to String
May 30, 2012 @ 1:53 am

Creating templated text output that's not tied to the HTTP output stream is a frequent requirement in my applications. Rendering confirmation emails, password resets, validations and notifications all generate text through templates that require string or stream output that doesn't get sent to HTTP. Here are some helpers that make it easy to create string output from MVC Views...

7 comments
DropDownList and SelectListItem Array Item Updates in MVC
May 16, 2012 @ 9:44 am

Ran into an 'interesting' behavior today with a cached list of SelectListItem[] in drop downlist where the cached list was getting updated by MVCs model binder.

10 comments
GZip/Deflate Compression in ASP.NET MVC
April 28, 2012 @ 4:00 am

If you want to create ASP.NET MVC content that uses gzip or deflate compression you need to use some custom code. Here's an action filter that compresses content in your ASP.NET MVC applications.

4 comments
ASP.NET MVC Postbacks and HtmlHelper Controls ignoring Model Changes
April 20, 2012 @ 2:19 am

Today I discovered an MVC behavior I hadn't noticed: For HTML helper controls MVC always uses POSTBACK values to display the control value rather than model values when the View is rendering in a POST back. In effect this means that MVC Views can't update the value of controls during a POST back using the standard HTML Helper Controls.

17 comments
Odd MVC 4 Beta Razor Designer Issue
April 14, 2012 @ 12:54 pm

I have an odd designer issue with MVC 4 Razor pages which are causing errors in the environment.

4 comments
Physical Directories vs. MVC View Paths
April 05, 2012 @ 2:38 pm

Physical directories that map paths that are also mapped by ASP.NET MVC routes can cause some consternation, especially if you're not aware that there's pathing overlap between the two. This post is a story about an operator error episode of an accidental file move that took a while to trace down due physical path interference.

4 comments
Using the HTML5 <input type="file" multiple="multiple"> Tag in ASP.NET
March 06, 2012 @ 1:54 am

HTML5 allows for multiple files to be uploaded from a single file input control. Here's how you can use it and capture files in ASP.NET.

7 comments
Getting a Web Resource Url in non WebForms Applications
October 05, 2011 @ 3:29 am

Need to retrieve Web Resource Urls from a .NET assembly, but not running in WebForms? Here's how you can create a small helper function that lets you retrieve WebResourceUrls from Razor or MVC applications.

2 comments
Integrating OpenID in an ASP.NET MVC Application using DotNetOpenAuth
September 17, 2009 @ 9:15 pm

OpenId is getting more popular and with it requests to integrate it into Web sites as a user authentication mechanism. In this post I'll discuss the OpenId integration on CodePaste.net in an ASP.NET MVC application disuccing both high level OpenId concepts, the process and the code implementation.

39 comments
Odd/Even Looping in ASP.NET MVC
August 31, 2009 @ 8:54 pm

Creating lists that have alternating display characteristics for alternating content are common and in MVC you have to do a little bit more work to make this happen. Here's an easy way to represent the expression using a boolean variable.

17 comments
WebResource access in ASP.NET MVC
July 30, 2009 @ 3:21 am

WebResources are useful when building more complex components. In MVC ASPX Views you can still access the ClientScript object to retrieve ResourceUrls, but outside of the ASPX view there's no easy access to the ResourceUrl. This post describes how grab resource urls in a couple of different ways.

16 comments
Introducing CodePaste.NET
July 21, 2009 @ 3:28 am

As a learning experience for taking ASP.NET MVC for a spin I recently created a new site that has now gone live: Codepaste.NET which provides a public location to post code snippet and link them from social network sites that have limited input lengths and make code discussions otherwise difficult. The site's a work in process, but I hope it's useful to some of you for sharing and discussing small blocks of code online.

24 comments
Url.Action() and RouteValue Encoding
July 19, 2009 @ 5:21 pm

When creating custom URLs with the UrlHelper.Action() method is a great way to create links to other URLs in the current Web application. However, you need to be careful of certain encoding issues as certain characters are not correctly encoded to work properly as parameters.

11 comments


West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2013