Click here to monitor SSC

Andrew Siemer

  • ASP.NET MVC Cookbook - public review

    Posted Monday, April 19, 2010 11:51 AM | 0 Comments

    I have recently started writing another book.  The topic of this book is ASP.NET MVC.  This book differs from my previous book in that rather than working towards building one project from end to end - this book will demonstrate specific topics from end to end.  It is a recipe book (hence the cookbook name) and will be part of the Packt Publishing cookbook series.  An example recipe in this book might be how to consume JSON, creating a master /details page, jquery modal popups, custom ActionResults, etc.  Basically anything recipe oriented around the topic of ASP.NET MVC might be acceptable. 

    If you are interested in helping out with the review process you can join the "ASP.NET MVC 2 Cookbook-review" group on Google here: http://groups.google.com/group/aspnet-mvc-2-cookbook-review

    Currently the suggested TOC for the project is listed.  Also, chapters 1, 2, and most of 8 are posted.  Chapter 5 should be available tonight or tomorrow.

    In addition to reporting any errors that you might find (much appreciated), I am very interested in hearing about recipes that you want included, expanded, or removed (as being redundant or overly simple).  Any input is appreciated!  Hearing user feedback after the book is complete is a little late in my opinion (unless it is positive feedback of course).

    Thank you!

  • Getting Spark View Engine to work with ASP.NET MVC

    Posted Sunday, January 31, 2010 8:41 PM | 1 Comments

    Method not found: 'Void System.Web.Mvc.ViewContext..ctor(System.Web.Mvc.ControllerContext, System.Web.Mvc.IView, System.Web.Mvc.ViewDataDictionary, System.Web.Mvc.TempDataDictionary)'

    I am finding that there are several complaints about getting Spark View Engine to work with ASP.NET MVC.  I had to tweak the Spark View Engine code base to get things running again.

    I had to download the spark view engine source code (http://sparkviewengine.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27600).  Once I did that I went through each of the projects that had a reference to the 1.0 version of System.Web.Mvc assembly and updated to reference to point to System.Web.Mvc 2.0.  From there you can build the solution (in visual studio) and you will find that a whole bunch of tests start to fail.  You can attempt to fix them (by adding the additional TextWriter parameter you will find is now needed).  You will also see that the SparkView.cs file complains about a missing parameter.  In the Render method (line 100 of the source code I downloaded) I had to update the instantiation of the wrappedViewContext to look like this (add writer to the end of the list of parameters):

        public void Render(ViewContext viewContext, TextWriter writer)
        {
            var wrappedHttpContext = new HttpContextWrapper(viewContext.HttpContext, this);
            var wrappedViewContext = new ViewContext(
                new ControllerContext(wrappedHttpContext, viewContext.RouteData, viewContext.Controller),
                viewContext.View,
                viewContext.ViewData,
                viewContext.TempData,
                writer); //  <-- add the writer to the end of the list of parameters
            ...
        }

    Once the code is updated you can run the build.cmd script that is in the root of the source you downloaded.  The build process will create a zip file in the build/dist folder.  Take those new dll's and add them to your website.  Things should work once again.

  • Can you help me formulate a TOC for an ASP.NET MVC Cookbook

    Posted Friday, January 15, 2010 3:15 PM | 1 Comments

    Hey there everyone.  I was recently tasked to pitch a book to my publisher.  As a first step I need to come up with an outline for the Table of Contents.  This book is the standard cookbook style with an added focus on the MVC side of ASP.NET.  I have been poking about at other similarly styled books to get some ideas.  I think comparing ASP.NET Web Forms to ASP.NET MVC would provide some folks with a good reference point when looking at the two ways of doing things. 

    (Thanks to my friend James Shaw for this idea.made my life easier)

    Below is what I have some up with so far.  Can you please take a quick look to make sure I haven't missed anything?  Perhaps more important than missing a topic.am I including too much?  Feel free to contact me directly with any comments at asiemer@hotmail.com or leave a comment below.

    Thanks!

    1. Working with the View

    1. Discovering the problems of a non-strongly typed view

    2. Creating a strongly typed view

    3. Working with a ViewModel

    4. How to use strongly typed input builders

    5. Create a custom input builder

    6. Consolidating view code into a partial view

    7. Using the Spark view engine

    8. Using the FubuMVC view engine

    9. Exposing a view that returns an image

    10. Creating a JSON result

    11. Consuming a JSON view

    12. Exposing a view that returns a PDF

    2. Actions

    3. Controllers

    4. Routes

    5. Master Pages

    1. How to create a master page

    2. Controlling which master page is used with a custom base page

    3. Working with Spark View Engine master pages

    6. Working with data in the view

    1. Reintroducing for and foreach

    2. Displaying data from an xml file

    3. Displaying an array as a group of check boxes

    4. Displaying an array as a group of radio buttons

    5. Creating a page-able set of data

    6. How to sort data

    7. Navigating to a specific page of data

    8. Deleting a record from a data set

    9. Adding a javascript delete confirmation pop-up

    10. Adding a modal window delete confirmation pop-up

    11. Displaying a modal window to show a records details

    12. Adding a totals row to the bottom of a set of data

    13. Using the free telerik grid

    7. Working with Forms

    1. Posting a form to the appropriate action

    2. Setting the field tab order

    3. Setting a default button

    8. MVC and templating

    1. Plugging in a new skin from the template gallery

    2. Using T4 to create strongly typed helpers

    3. Using T4MVC to destroy magic strings

    4. Creating a view template

    9. Validation Recipes

    1. Validating with Data Annotation Validators

    2. Reporting validation errors with ViewData.ModelState

    3. Using Html.ValidationMessage to display validation errors

    4. Summarizing validation errors with Html.ValidationSummary

    5. Using the xVal validation framework

    6. Using Castle Validator for validation

    7. Client side validation with JQuery Validation

    8. Making a required field

    9. Setting an acceptable range

    10. Requiring the password and password verification fields to match

    11. Using a regex pattern to validate data

    12. Forcing a choice to be made in a drop down menu

    10. Managing large applications with Areas

    1. Creating a separate project as an area

    2. Creating an area in the same project

    3. Using areas to manage segments of your site

    4. Creating portable areas to compartmentalize functionality

    11. Maintaining state

    1. Working with application wide information

    2. Maintaining a user's information during their session

    3. Using cookies to remember a user

    4. Managing state in a web farm scenario using SQL Server

    12. Error Handling

    1. Handling errors in your code

    2. Handling errors for a view

    3. Handling errors in your application

    4. Showing friendly error information

    5. Using Error Logging Modules and Handlers (ELMAH) to deal with unhandled exceptions

    6. Reporting caught exceptions to ELMAH

    13. Security

    1. Using membership and roles to manage users

    2. Using windows authentication

    3. Restricting access to all pages

    4. Restricting access to selected pages

    5. Restricting access to pages by role

    6. Restricting access to a controller

    7. Restricting access to a selected area

    14. Profiles and Themes

    1. Using profiles

    2. Inheriting a profile

    3. Using an migrating anonymous profiles

    4. Managing user profiles

    5. Using themes

    6. User personalized themes

    15. Configuration

    1. Adding custom application settings in web.config

    2. Displaying custom error messages

    3. Maintaining session state across multiple web servers

    4. Accessing other web.config configuration elements

    5. Adding your own configuration elements to web.config

    6. Encrypting web.config sections

    16. Tracing and Debugging

    1. Uncovering page level problems

    2. Uncovering application wide problems

    3. Writing trace data to the event log

    4. Sending trace data via email

    5. Using a breakpoint to stop execution of an application when a condition is met

    17. Caching

    1. Caching a whole page

    2. Caching pages based on route details

    3. Caching pages based on browser type and version

    4. Caching pages based on developer defined custom strings

    5. Caching partial pages

    6. Caching application data

    7. Caching object data

    8. Installing MemCached Win32 as an alternate cache provider

    9. Using the MemCached Enyim client to cache application data

    10. Installing Microsoft Velocity

    11. Using Velocity to cache application data

    18. Localizing your application

    1. Providing multiple language support

    2. Using resource files to manage display data

    3. Managing currency display based on selected language

    19. HTTP Handlers and Modules

    1. Tracking access to your resources with an HTTP Handler

    2. Create a file download HTTP Handler

    3. Control leeching of your resources with an HTTP Module

    20. Making ASP.NET even more powerful

    1. Making controllers testable by implementing a ControllerFactory

    2. Implementing inversion of control with StructureMap

    3. Install MVC Turbine and write less code

    4. Creating testable views

    5. Creating testable controllers

<February 2012>
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910
How to Kill a Company in One Step or Save it in Three
 The majority of companies that suffer a major data loss subsequently go out of business. David Wesley... Read more...

Migrating from OCS 2007 R2 to Lync: Part 4
 Having migrated the rest of our users and legacy resources across, and start getting ready to... Read more...

Automated Script-generation with Powershell and SMO
 In the first of a series of articles on automating the process of building, modifying and copying SQL... Read more...

Seth Godin: Big in the IT Business
 Seth Godin has transformed our understanding of marketing in IT. He invented the concept of 'permission... Read more...

Using SQL Test Database Unit Testing with TeamCity Continuous Integration
 With database applications, the process of test and integration can be frustratingly slow because so... Read more...