ASP.NET MVC Tip #30 – Create Custom Route Constraints
In this tip, I show how you can create custom route constraints that prevent you from accessing a URL unless you are local and authenticated. I show you how you can create a LocalConstraint and an AuthenticatedConstraint. I also demonstrate how you can test your custom constraints. When you create ......
Displaying a Message in Response to Some Action and Then Hiding It on Subsequent Postbacks
ASP.NET web pages commonly display messages in response to user actions. For instance, a typical CRUD
(Create, Read, Update, Delete) web page might display the message, "Record deleted" immediately after deleting a record and the message "Record updated"
immediately after updating a record. Li......
Hey Ma, I’m On TV!
Recently, Adam Kinney came by my office to interview me for a Channel 9 episode discussing ASP.NET MVC CodePlex Preview 4. I’ve known Adam for a long time, even before he joined Microsoft. I think we met (in person) at Tech-Ed 2003. In any case, we talk a bit about ASP.NET MVC and Preview 4, all th......
100+ PDC Sessions Posted
I just saw that we released another round of PDC sessions... This is the first PDC for years where I have not been personally deeply involved in the planning, so it is fun for me to watch in unfold.. https://sessions.microsoftpdc.com/public/sessions.aspx If you have not already, please regist......
ASP.NET Podcast Show #121 - Phil Haack with an ASP.NET MVC Demo - Video
Subscribe to Everything.
Subscribe to WMV format.
Subscribe to M4V for iPod Users.
Subscribe to MP3 (Audio only).
Download WMV.
Download M4V for iPod Users.
Download MP3 (Audio Only).
Original Url: http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2008/07/29/asp-net-podcast-show-1......
ASP.NET MVC Tip #29 – Build a Controller to Debug Your Custom Routes
In this tip, I demonstrate how you can create a special controller that you can use to test your custom routes. I also explain how you can give your routes back their names so you can more effectively unit test your routes. In this tip, I demonstrate how you can create a custom controller that you ......
ASP.NET MVC Application Building #1: Family Video Website – Upload the Videos
In this series of blog entries, I build an entire ASP.NET MVC application from start to finish. I create a Family Video Website that you can use to host home videos and photographs. I have three young children at home, a wife, and a dog. I live in Seattle and my 95 year old grandmother lives in Cal......
ASP.NET MVC Tip #28 – Test If Caching Is Enabled
In this tip, I demonstrate how you can test if the OutputCache attribute is present on a controller action. I also demonstrate how you can test if the OutputCache attribute is set with a particular duration. Caching is the most effective way to improve the performance of an ASP.NET MVC application.......
ASP.NET MVC Tip #27 – Create ASP.NET MVC Specific Visual Studio Add-Ins
In this tip, I discuss Eric Hexter’s TDD Class Generator Add-In for Visual Studio. This Add-In enables you to generate a class, an interface, and a test class by entering a single keyboard shortcut. Eric Hexter -- who has done valuable work on the MvcContrib project -- visited Microsoft last ......
Final Two Master Page Tutorials Published
The final two tutorials (#9 and #10) of my Master Pages Tutorial series are now available on www.asp.net. These tutorials explore two advanced master page scenarios:
Specifying the Master Page Programmatically [VB | C#] - in most cases a content page's master page is specified statically throug......
ClubStarterKit - where do we go?
Wow, what a year. Not exactly what I'd expected. Before I dive into where we are now, let me preface this post by saying I have NOT forgotten ClubStarterKit! Although I was not the original author, I feel like it's my baby. I can't just forget about it. Not going to happen. You might be quic......
How to Program Visual Basic 2008 - a master text.
Deitel books are great learning tools and often used as course text or soup to nuts learning guides. Also the physical quality of the book (printing, paper choice, color, etc) make it a collectors item if your a book lover) I had the pleasure of being a technical reviewer on this one (though the wa......
ASP.NET MVC Tip #26 – Create a Lightweight Control View Engine
In this tip, I show you how to create a custom ASP.NET MVC view engine that supports lightweight, declarative controls. I show you how to create both simple controls and controls that display database data. I also show you how to test the rendered output of the lightweight controls. One of the beau......
August's Toolbox Column Online
My Toolbox column in the August 2008 issue of MSDN Magazine is avaiable online. The July issue examines:
FileHelpers - .NET includes XML serialization capabilities, which makes it easy to load an XML file into a collection of objects and to save object state back out to an XML file. If you need ......
www.ASP.net - What's Missing ?
Next week I have a week full of meetings on things like. The Next Version of Web Forms Dynamic Data v.now and v.next ASP.NET 4.0 But the BIG part of the week will be spent on strategic planning for www.ASP.net web sites in the coming year. We want to answer questions like .... What's the NEXT g......
ASP.NET MVC Tip #25 – Unit Test Your Views without a Web Server
In this tip, I demonstrate how you can unit test ASP.NET MVC views without running a Web server. I show you how to unit test views by creating a custom MVC View Engine and a fake Controller Context. The more of your web application that you can test, the more confident that you can be that changes ......
Email Verification for New Accounts via ASP.NET's Membership Framework
In my last blog entry, The CreateUserWizard and Validation ErrorMessages, reader Andrei Rinea commented:
I wish the whole Membership set of controls would be replaced with better ones. Very often I need to have an authentication/authorization mechanism that doesn't need a username but an e-mail.......
The CreateUserWizard and Validation ErrorMessages
The CreateUserWizard control introduced in ASP.NET 2.0 makes it easy to create a new user account on a website that uses the Membership framework. (See my Creating User Accounts tutorial for more information on using this control.) Out of the box, the CreateUserWizard control offers a fully functio......
Alternating styles in ListView without AlternatingItemTemplate
ListView (the server-side control), like all repeating data controls in ASP.NET, has an AlternatingItemTemplate, but it would be a shame to have to copy all the markup in the ItemTemplate into AlternatingItemTemplate, just to alternate styles on the items. It's quite likely that only css classes wi......
ASP.NET MVC Tip #24 – Retrieve Views from Different Folders
In this tip, I demonstrate how you can retrieve a view from any folder in an ASP.NET MVC application. I show you how to use both specific paths and relative paths. Until today, I thought that a controller action could return a view from only one of two places: · Views\ controller name · V......
Examining ASP.NET 2.0's Membership, Roles, and Profile - Part 12
Several of the earlier installments in this article series examined how to apply authorization rules in order to prohibit particular users, roles,
or classes of users from accessing particular resources. For instance, Part 2
showed how to define URL-based authorization rules in web.config for ......
Examining ASP.NET's Membership, Roles, and Profile - Part 12
Several of the earlier installments in this article series examined how to apply authorization rules in order to prohibit particular users, roles,
or classes of users from accessing particular resources. For instance, Part 2
showed how to define URL-based authorization rules in web.config fo......
ASP.NET - Render Hidden Fields at the Top of a Form with .NET 3.5 SP1
I just came across a nice feature in ASP.NET 3.5 SP1 (currently in Beta) that I didn’t realize was included. It’s always nice to discover hidden gems from time to time. With ASP.NET 1.0, 1.1, 2.0 and 3.5 applications if a user or JavaScript function tried to do a postback before all o......
The Weekly Source Code 30 - Spark and NHaml - Crazy ASP.NET MVC ViewEngines
I've been getting more and more interested in how folks extend their applications using plugins and things. In my new ongoing quest to read source code to be a better developer , Dear Reader, I present to you thirtieth in a infinite number of posts of " The Weekly Source Code ." Spark......
IronRuby With ASP.NET MVC Working Prototype
In June, John Lam wrote about a demo he gave at Tech-Ed 2008 where he showed IronRuby running on ASP.NET MVC. He posted the code for the demo online, but it relied on an unreleased version of MVC, so the code didn’t actually work. Now that Preview 4 is out, I revisited the prototype and got it work......
Will ASP.NET MVC be the main web UI platform for ASP.NET?
Microsoft folks are very enthusiastic ! We love to dig in to new technology and show off the cool work that we do and this has been VERY true of ASP.NET MVC. Unfortunately, sometimes our zeal get's misinterpreted. I'm getting lots of questions about the future of ASP.NET development as it p......
Proof of Concept: a simple DI solution for ASP.NET WebForms
Chris Tavares and I were chatting yesterday morning about an idea Chris had: building a simple, reusable Http Module that gives folks DI scoped to the Application, Session, and Request. Yesterday afternoon, during the p&p Dev team's weekly "Code Kata" we threw together a spike/pro......
Instinct Experiment Over…Back to Windows Mobile
Over the past few weeks I’ve been trying out the Sprint Instinct touch screen phone to see how I liked it. I wrote my initial review here and posted some tips and tricks on using the device here. The poor browsing experience on the Instinct finally led me to take it back to the store ye......
Notes on ASP.NET MVC CodePlex Preview 4
(If you want to skip all the blah blah blah, go straight to the release ) What I love about working with The Gu (aka ScottGu, the man with many aliases) is that he makes my life easier with his gargantuan and detailed blog posts covering the features of each release. This allows me to follow up and......
Summer ASP.NET Missions
Spring is ugly in my job. From early March until late June I'm on the road. Conferences, Meetings, etc. Then when I finally get done my spring traveling.... There is "make up" work to do. I have to "make it up" to my two little princess and my wife. Work my way through a who......
Sprint Instinct Tips and Tricks
In a previous post I discussed some of the pros and cons of the new Sprint Instinct phone that I recently purchased. I’ve had the phone for a few weeks now and still like it a lot overall. It’s not nearly as flexible as the PPC-6700 phone I had previously when it comes to installing so......
July's Toolbox Column Online
My Toolbox column in the July 2008 issue of MSDN Magazine is avaiable online. The July issue examines:
ScrewTurn Wiki - a wiki is a web application whose content is maintained by its users. Adding a wiki to your site is remarkably easy with ScrewTurn Wiki, a free, open-source ASP.NET wiki applic......
Techniques for Randomly Reordering an Array
While reading through some of Jeff Atwood's old blog entries, I stumbled across this gem:
The Danger of Naivete. In it, Jeff discussed the pitfalls the can befall a programmer
who implements a naive algorithm and calls it a day. Consider an algorithm to randomly reorder an array. If you have a ......
Pros and Cons of the Sprint Instinct Phone
There’s been a lot of hype over Apple’s new iPhone 3G coming out on July 11th as well as Sprint’s recently released Instinct phone. I was originally going to switch over to AT&T and get the iPhone but it meant switching my wife over as well since we need to be able to call each other wit......
Random Grammar/Style Question
When writing my Security Tutorials for www.asp.net, I often wrote sentences like the following: “To log in to the site, ...” Although sometimes I'd write it, “To log into the site, ...” and other times I'd use, “To login to the site...”
I can't say with certainty whether any one of these three are......
Examining ASP.NET's Membership, Roles, and Profile - Part 11
Many websites that support user account allow anyone to create a new account, but require new users to undergo some form of verification before their
account is activated. A common approach is to send an email to the newly created user with a link that, when visited, activates their account. Th......
The Economics Behind Writing Subsequent Editions (for Computer Trade Books)
The economics behind the college text book must be interesting. I've not written any textbooks, so my comments here are based more on assumption than knowledge, but what I but what always intrigued me - whilst a college student, at least - was how authors would release different versions of books a......
ASP.NET Podcast Show #118 - Paul on Peer-To-Peer with Windows Communication Foundation
Subscribe
to EVERYTHING <-- What you REALLY WANT TO DO!
Original Url: http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2008/06/19/asp-net-podcast-show-118-paul-on-peer-to-peer-with-windows-communication-foundation.aspx Subscribe
to WMV Video only.
Subscribe
to M4V Video onl......
Two New Master Page Tutorials Published
As I noted in an earlier blog post, in May the first of my Master Pages tutorials were published on www.asp.net. Two new master page tutorials were put online today:
URLs in Master Pages [VB | C#] - one challenge with master pages is that the master page and linked resources - image files, hyper......
New Features in Silverlight 2 Beta 2
Bill Gates and S. Somasegar announced several new features at TechEd for Silverlight Beta 2 that are great additions to the existing functionality. Here's a list of the highlights in Beta 2: UI Framework: Beta 2 includes improvements in animation support, error handling and reporting, aut......
ASP.NET MVC Support with Visual Web Developer 2008 Express
Last week I blogged about the ASP.NET MVC Preview 3 release. One important thing I forgot to mention about this release is that you can now use it with both Visual Studio 2008 as well as the free Visual Web Developer 2008 Express edition. The SP1 release of Visual Web Developer 2......
Alter your ASP.NET Blog with the Raw Header Text box inside the Control Panel
I only noticed today that you can to the head element of the ASP.NET blog using the Raw Header Header Text Box inside the Control Panel. I have as you can see made a few changes which I have actually wanted to do for a while but thought that constraints prevented me from doing so. If yo......
Resharper 4 BETA Released
Avoid Much Talk
I wrote about Resharper 4 performance improvements in an earlier blog post today showing my VS Color Scheme including use of R# nightly builds. My friend Mohamed Tayseer pointed me out that Resharper 4 BETA was released yesterday. If you already know Resharper, skip the blah blah......
A New Tutorial Series on Master Pages
Over the past two years I've been working on a number of step-by-step tutorials for Microsoft's www.asp.net website. The two complete tutorial series are:
Working with Data in ASP.NET
Website Security: User Accounts, Membership, Roles, and Form Authentication
I'm happy to announce a new tutori......
Accessing and Updating Data in ASP.NET 2.0: Using Optimistic Concurrency
Because multiple users can visit the same web page concurrently, it is possible for a user visiting a data modification page to inadvertently overwrite
the modifications made by another user. Consider a page with an editable GridView. If two users visit this page simultaneously from different comp......
Accessing and Updating Data in ASP.NET 2.0: Using Optimistic Concurrency
A Multipart Series on ASP.NET 2.0's Data Source Controls
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This art......
The 21 most popular blog posts
I started this blog 2.5 years ago today, mostly because I felt that the same types of issues came up over and over and over in our support cases. I figured that if I started writing about them, a lot of people would be able to resolve them on their own, or even better avoid them in the first place.......
Warning the User When Caps Lock is On
After my first batch of Security Tutorials were published on www.asp.net, a reader emailed me asking if it was possible to display some sort of warning if the user has Caps Lock on whilst entering their password into the Login control. While JavaScript cannot indicate if Caps Lock is on or not, you......
Professional ASP.NET 3.5 Book (only $16 on Amazon for a short time)
One of the things I like to track are book sales on Amazon.com, which provides a useful data point to monitor what developers are interested in on any given day. I use the www.TitleZ.com site (which is built using ASP.NET) to track specific titles I want to watch - it then generates a repo......
Working with XML Data Using LINQ, a TreeView, and a ListView :: Editing Data
ASP.NET includes a variety of tools for displaying and editing XML documents. A previous article, Working
with XML Data Using LINQ, a TreeView, and a ListView :: Displaying Data, showed how with a TreeView control, a ListView control, an XmlDataSource control,
a LinqDataSource control, and abou......