The ASP.NET team shipped ASP.NET MVC 2 Release Candidate 2 for VS 2008/.NET 3.5, and it’s the sequel to the RC version made available in December. It features bug fixes, performance optimizations, and API and behavior additions/changes. Below are a few of the changes between the RC1 and RC2 release (read the release notes for even more details):
- The new ASP.NET MVC 2 validation feature now performs model-validation instead of input-validation (this means that when you use model binding all model properties are validated instead of just validations on changed values of a model). This behavior change was based on extensive feedback from the community.
- The new strongly-typed HTML input helpers now support lambda expressions which reference array or collection indexes. This means you can now write code like Html.EditorFor(m=>m.Orders[i]) and have it correctly output an HTML <input> element whose “name” attribute contains the index (e.g. Orders[0] for the first element), and whose “value” contains the appropriate value.
- The new templated Html.EditorFor() and Html.DisplayFor() helper methods now auto-scaffold simple properties (and do not render complex sub-properties by default). This makes it easier to generate automatic scaffolded forms. I’ll be covering this support in a future blog post.
- The “id” attribute of client-script validation message elements is now cleaner. With RC1 they had a form0_ prefix. Now the id value is simply the input form element name postfixed with a validationMessage string (e.g. unitPrice_validationMessage).
- The Html.ValidationSummary() helper method now takes an optional boolean parameter which enables you to control whether only model-level validation messages are rendered by it, or whether property level validation messages are rendered as well. This provides you with more UI customization options for how validation messages are displayed within your UI.
- The AccountController class created with the default ASP.NET MVC Web Application project template is cleaner.
- Visual Studio now includes scaffolding support for Delete action methods within Controllers, as well as Delete views (I always found it odd that the default T4 templates didn’t support this before).
- jQuery 1.4.1 is now included by default with new ASP.NET MVC 2 projects, along with a –vsdoc file that provides Visual Studio documentation intellisense for it.
- The RC2 release has some significant performance tuning improvements (for example: the lambda based strongly-typed HTML helpers are now much faster).
Today’s RC2 release only work with VS 2008 and .NET 3.5. We’ll shortly be releasing the VS 2010 RC (which will be available for everyone to download). It will include ASP. NET MVC 2 support built-in (no separate download required).
You can download it here.
Source: ScottGu
I’m at it again. Yesterday when working on a simplistic WPF form for a user profile configuration scenario, Visual Studio did it again with a bang, crashing in all it’s glory when switching to designer view.
What solved the problem? Well… Erasing the solution .suo file so that the IDE doesn’t crash on startup if, by any chance, a xaml document is open in design view, and installing the following hotfix made available by Microsoft:
KB963035 - VS2008 SP1 sometimes hangs irretrievably after WPF Designer
This hotfix relates to the Visual Studio IDE hanging, not crashing. But nevertheless It can be a valuable contribution to solving the problem.
Cleaning the solution also solved the problem in some cases, from what I’ve read and heard.
When designing UI’s in WPF and Silverlight, you may wish to make your layout fluid and auto-expandable in order to take the most out changing UI context. For instance, when data quantity and quality changes, available space may also change and objects in the layout need to adapt to these changes. When an auto layout is needed, no width nor height are specified which can be troublesome since the design view tends to collapse available space. For instance, a variable size user control with a data-binded listbox has no child items in design time, so you’ll see nothing but a small dot. This is because Cider, the Visual Studio Designer, and Blend designer, have no reason to show it otherwise since there’s no content and, as such, the ability to publish and preview isn’t possible.
In expression blend however, there’s a nice feature that solves this issue, and it’s only enabled at design time. When you create a new visual object in Blend, you’ll notice the following xml namespace declaration:
...
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
...
This enabled a “d” keyword that can be attached to a visual object in order to set its size only at design time. At runtime, the regular sizing settings are considered. So, if we had the following User Control, with data items applied at runtime through databinding:
<UserControl x:Class="NetBrainwork.Temp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ListBox Name="DemoListBox" ItemsSource="{Binding MyCollection}"></ListBox>
</UserControl>
This is what you would see in Blend:
So you see that testing background coloring, for instance, isn’t very practical with this view. So the solution lies in the two Blend design-time attached properties: DesignWidth and DesignHeight, available in the namespace specified above. Notice the two right and bottom rectangular adorners in the previous picture: they’re Blend’s way of settings these values. If you resize your control with those rectangles you’ll be setting your desired design-time size. The XAML output would be something like this:
<UserControl x:Class="WpfUnderTheHood.Temp"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="200" d:DesignHeight="200">
<ListBox Name="DemoListBox" ItemsSource="{Binding MyCollection}"></ListBox>
</UserControl>
And this is what you’d see:
Like I said earlier, at runtime this setting isn’t considered, and auto layout is applied.
Technorati Tags:
WPF,
Silverlight
David Hill from the patterns & practices team posted a very interesting article concerning MEF and Prism. It talks about the benefits your applications get from using these extensibility technologies, but also clears some misunderstandings regarding their purpose. I’ve been faced with this question several times and the online community reflects this same common overlap. While MEF is purely an extensibility API, Prism is a development pattern that allows you to organize and manage your WPF/Silverlight project through modularity and thus isolate requirement and functionality concerns in development teams.
They’re both part of .NET Framework 4.0 and a MUST if you are developing big applications and/or needing your software to be extensible.
Check out the article here.
Technorati Tags:
MEF,
Prism,
WPF,
Silverlight,
.NET Framework 4.0
Following September's launch of the new Microsoft CDN (Content Delivery Network Service), in which you can reference ajax libraries in cache, Microsoft recently added SSL support, thus confirming Microsoft's announcement back then. This new feature is necessary in websites that have SSL enabled pages and script library references in them. What would happen until now was a message displaying "This page contains both secure and non-secure items...".
SSL support is now enabled with the scripts hosted on the Microsoft AJAX CDN. Simply use an “https” moniker with any script references on your site that point to the CDN, and they will now be served over SSL. For example, below is how you can reference jQuery over SSL:
<script src="https://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
For more information, check out the Microsoft Ajax Content Delivery Network website. At the bottom there's a useful list of ASP.NET Ajax Libraries hosted on the CDN.
Technorati tags: ASP.NET, Javascript
Technorati verify: 4J8KBSATVCQV
Just posted another article from a series of articles regarding the jQuery Library. This next iteration explains all the major areas of this magnificent API, and targets element selection and filtering through some basic explanation and examples. Don't miss out if you're getting into jQuery.
jQuery Tutorial Part 1
jQuery Tutorial Part 2
Saw a great vide this weekend about Silberlight 4’s new OOB capabilities. Joe Stegman, Director of Program Management on the Silverlight team, went on camera in Channel 9 to talk about Silverlight 4's Out of Browser improvements. OOB means that you can run a Silverlight application on your desktop, outside the usual browser enviroment.
Check it out here: Channel 9
Technorati Tags:
Silverlight
At the Professional Developers Conference 2009, Microsoft announced public beta of Office Professional Plus 2010 productivity suite. In all the fanfare, Stephen Chapman of Microsoft Kitchen managed to grab a Microsoft roadmap pointing next Windows operating system's arrival.
Microsoft launched Windows 7 on October 22 and now the plans of Windows 8 roadmap were spotted on the Interwebs. The successor to Windows 7 is tentatively codenamed as Windows 8 and is expected to be next "Major Release" in 2012. On the contrary, Windows 7 is being treated as "Release Updates" - to what? Maybe the wild Vista code.
This means there will be a three year gap till next Windows Operating system and their rival Apple believes in keeping two year gap - between Leopard and Snow Leopard. In these two-three years, both OS-making giants want the consumers to get used the new technologies incorporated in their OS and be ready for new ones.
Before you start making Windows 8 features wishlist, start using Windows 7 extensively and then list down what you wish to see next. Obviously, Gamers would love to go for DirectX12 and who knows what would be incorporated in it.
Technorati Tags:
PDC 2009,
Windows 8
A lot has been talked about recently regarding Internet Explorer 9. At the PDC, Steven Sinofski talked about IE9’s new development lines and there are some interesting features and improvements being taken care of. For starters, the standards! IE9 will support CSS 3.0 and HTML 5, which was already expected.
Performance-wise, Microsoft is making a huge investment. Performance disadvantages of IE8 are widely known and the team wants to change this in the 9th iteration of Internet Explorer.
Javascript rendering engine and DOM processing are getting huge improvements. Steven admitted that script performance in IE was the worst, and this was shown in a chart ported in the IEBlog, on the left.
Also, DirectX will be put into the equation. PC hardware will be taken into account on web page text and image rendering and animations.
Technorati Tags:
IE,
Javascript,
CSS,
HTML,
PDC 2009
A lot has happened in PDC 2009. Although I couldn’t make it this year, I’ve been watching it very closely from the keynotes, session contents, technologies, attendees, the space, chill out zone and merchandising. XAML-wise, there were some glorious days.
Some cool WPF 3 and 4 apps were shown in day 2 of this year’s PDC, like Saesmic, a Tweeter and Facebook desktop client for MAC and Windows, Pivot, from Microsoft labs, Fishbowl, another facebook desktop client, and I’ve been inspecting every one of them. Aside from the release of Silverlight 4 Beta, IE 9 video demo, Office 2010 Beta, these apps made the delights of the participants as well.
Saesmic
In the day 1 Keynote, featuring Ray Ozzie, Chief Software Architect at Microsoft, Saesmic was announced as a feature-rich native application for Windows now available.
Partnered with Microsoft, engineered for Windows and optimized for Windows 7, this preview version of Seesmic for Windows combines the best features from Saesmic web and provides them in a native Windows environment.
Fully functional with Twitter, Seesmic is a simple yet powerful client application that allows you to:
- Manage and post from multiple twitter accounts
- View aggregated Home, Replies, Private and Sent columns.
- Create and save searches
- View and add to your Twitter lists
- Create unlimited columns
- Enable choice of multiple image and url shortening services
- Manage notification of your messages.
Pivot
My favorite. It requires an invite for you to install it, but it’s worth it. Pivot makes it easier to interact with massive amounts of data in ways that are powerful, informative, and fun.
A lot has been done in terms of user interaction and data accessibility. The team has made a significant effort in designing an interaction model that accommodates the complexity and scale of information rather than the traditional structure of the Web. Like I said, it requires an invite code, which you can get by submitting your email at the Pivot website.
I would strongly recommend taking some time to read the developer’s information, available at the website. It is interesting to see how data collections are treated and the general architecture of this platform.
Fishbowl
Another sample shown from the uxlabs team at Microsoft is Fishbowl. Fishbowl is a trial application and a sample demonstrating a unique user experience with Facebook content, optimized for Windows 7. It is available for download by technology enthusiasts and Facebook power users. Since it's currently a trial version, they don't support it. But who cares, right??
Technorati Tags:
WPF,
Silverlight,
XAML,
PDC 2009