Articles : Page 1 of 3
-
April 14th Links: ASP.NET, ASP.NET MVC, ASP.NET Web API and Visual Studio
Apr 1215Here is the latest in my link-listing blog series: ASP.NET Easily overlooked features in VS 11 Express for Web: Good post by Scott Hanselman that highlights a bunch of easily overlooked improvements that are coming to VS 11 (and specifically the free express editions) for web development: unit testing, browser chooser/launcher, IIS Express, CSS Color Picker, Image Preview in Solution Explorer and more. Get Started with ASP.NET 4.5 Web Forms: Good 5-part tutorial that walks-through build...
-
Physical Directories vs. MVC View Paths
Apr 1205This post falls into the bucket of operator error on my part, but I want to share this anyway because it describes an issue that has bitten me a few times now and writing it down might keep it a little stronger in my mind. I've been working on an MVC project the last few days, and at the end of a long day I accidentally moved one of my View folders from the MVC Root Folder to the project root. It must have been at the very end of the day before shutting down because tests and manual site nav...
-
Rebuilding CoasterBuzz, Part III: The architecture using the "Web stack of love"
Apr 1203This is the third post in a series about rebuilding one of my Web sites, which has been around for 12 years. I hope to relaunch in the next month or two. More: Part I: Evolution, and death to WCF Part II: Hot data objects I finally hit a point in the re-do of CoasterBuzz where I feel like the major pieces are in place... rewritten, ported and what not, so that I can focus now on front-end design and more interesting creative problems. I've been asked on more than one occasion (OK, just...
-
ASP.NET MVC 4 Beta
Feb 1220A few days ago we released the ASP.NET MVC 4 Beta. This is a significant release that brings with it a bunch of great new features and capabilities. The ASP.NET MVC 4 Beta release works with VS 2010 and .NET 4.0, and is side-by-side compatible with prior releases of ASP.NET MVC (meaning you can safely install it and not worry about it impacting your existing apps built with earlier releases). It supports a “go-live” license that allows you to build and deploy production apps with it. Click ...
-
Loading jQuery Consistently in a .NET Web App
Oct 1110One thing that frequently comes up in discussions when using jQuery is how to best load the jQuery library (as well as other commonly used and updated libraries) in a Web application. Specifically the issue is the one of versioning and making sure that you can easily update and switch versions of script files with application wide settings in one place and having your script usage reflect those settings in the entire application on all pages that use the script. Although I use jQuery as an exa...
-
Getting a Web Resource Url in non WebForms Applications
Oct 1105WebResources in ASP.NET are pretty useful feature. WebResources are resources that are embedded into a .NET assembly and can be loaded from the assembly via a special resource URL. WebForms includes a method on the ClientScriptManager (Page.ClientScript) and the ScriptManager object to retrieve URLs to these resources. For example you can do: ClientScript.GetWebResourceUrl(typeof(ControlResources), ControlResources.JQUERY_SCRIPT_RESOURCE); GetWebResourceUrl requires a type (which is use...
-
Adding Export Capabilities to the Razor WebGrid
Sep 1103When MVC first came out I really missed having a grid control. Now a few years later, we finally have a grid control again. In case, you didnt know the WebGrid was included in the System.Web.Helpers assembly which shipped with MVC 3. After using a variety of grid controls over the years I was actually glad that the API for the new WebGrid was kept clean and simple. Here is a screenshot of what the grid looks like: To display a grid on a razor view page, you basically create a new grid objec...
-
A Simple 2-Column Layout in Razor
Aug 11222 column layouts are rather popular on the web, and there are 1,001 ways to make them work. The approach you choose really depends on the type of content you have, and how you want images and backgrounds to work. What I'll show is the Razor _Layout and CSS to achieve the following look: The Razor _Layout file can rely on partial views to handle each of the primary sections: top, navigation, sidebar, and footer. RenderBody will produce the primary content area. <!DOCTYPE html> <html> <hea...
-
Writing an ASP.NET MVC Controller Inspector
Aug 111199.99999% of the time (yes, I measured it), a controller in ASP.NET MVC is a type, and an action is a method — with reflection as the glue that holds it all together. For most folks, that’s the best way to view how ASP.NET MVC works. But some folks like to dig deeper and get their hands dirty a bit by taking a peek under the hood. Doing so reveals that while the reflection based mapping of controllers types and actions to methods is true by default, it can be easily changed to something else...
-
Two bugs in ASP.NET MVC 3 and a workaround for both
Jun 1114So I spent an hour today arsing about with a couple of ASP.NET MVC 3 bugs. One was a Routing issue that caused it to act differently to MVC 2. The second I found was a FormsAuthentication issue that insisting on sending me to /Account/Login. Amazing how this crept in really given that it was community tested to death with such a massive ASP.NET MVC following so it is a wonder they weren't weeded out and fixed before RTM. Oh well, don't pretend you don't like a challenge. Routing doesn't work t...

