<%@ Register Src="~/controls/textLinkAds.ascx" TagName="textLinkAds" TagPrefix="tla"%> SuperWasp - Productivity tips, reviews, tools, software and gadgets.
SuperWasp

SuperWasp

Productivity tips, reviews, tools, software and gadgets.

 
Microsoft releases .NET Framework 3.5 Service Pack 1

Microsoft .NET Framework 3.5 Service Pack 1 is a cumulative update with service updates to the .NET 2.0 and 3.0 subcomponents, and contains many new features for the .NET Framework 2.0, 3.0, 3.5.

Quick overview of what’s new:

  • ASP.NET Dynamic Data is now included, providing rich scaffolding framework for rapid data driven development without writing code. See What's new in ASP.NET and Web Development for more info.
  • Addition to ASP.NET AJAX for managing browser history (back button support).
  • Core improvements to the CLR (Common Language Runtime)
  • Performance improvements to WPF (Windows Presentation Foundation)
  • Additional functionality in WPF: better support for line of business apps, native splash screen support, DirectX pixel shader support, and a new WebBrowser control.
  • ClickOnce application publishers can opt out of signing and hashing.
  • Entity Framework (an evolution of the well known ADO.NET) is included and has new features like support for SQL Server 2008. See Getting Started with the Entity Framework for more info.
  • LINQ to SQL and SqlClient (.NET Framework Data Profider for SQL) now support the date and file stream capabilities in SQL Server 2008.
  • ADO.NET Data Services Framework is included, and enables data to be exposed as flexible REST (Representational State Transfer) data services.
  • Windows Communication Foundation (WCF) has improvements to the DataContract Serializer.

Downloads & links:

After installation, immediately install the update KB959209 to address a set of known application compatibility issues!

Labels: , , , , , , ,

» Full Article

  Posted by oVan on Wednesday, January 07, 2009 | PermaLink | 0 comments
How-To: Build Language dropdown with ASP.NET MVC and LINQ

Here's a quick way to build a language dropdown box with ASP.NET MVC Preview 3, without using a database table. In total we need only 3 lines of code.

1. Controller:

Screenshot of MVC Controller Action in VS2008

In our controller, we add the following code to the controller action:

List<System.Globalization.CultureInfo> Locales =
    System.Globalization.CultureInfo.GetCultures(
        System.Globalization.CultureTypes.NeutralCultures).ToList();

ViewData["Locales"] = new SelectList(
    Locales
    .OrderBy(lc => lc.Name.Length)
    .ThenBy(lc => lc.DisplayName),
    "Name",
    "DisplayName");

First we create a list of CultureInfo and store it in a variable Locales. For this example I've used NeutralCultures to limit the entries to the most used languages, otherwise you'll get a very long list.

Next we create a ViewData object and fill it using SelectList, passing along our Locales variable.

Note: I've sorted Locales twice, first with OrderBy and then with ThenBy. As parameter we throw in a Lambda expression to transform our Locales and get the member we want. The reason I sort on Name.Length first is that the Invariant CultureInfo has an empty Name and thus it will be sorted to the top of the list.

After that we simply render our View (in this case passing along a Contact record from the database.

2. View:

The code in our view is even simpler. With the help of Extensions and MVC HtmlHelper objects we have our dropdown box in no time:

Screenshot of MVC View in VS2008

The only line of code to render the fully functional html select dropdown box is this:

<%=Html.DropDownList("Locales") %>

Here is the final result:

Final result: dropdown box

A quick look at the produced code shows us the clean XHTML underneath:

<select name="Locales" id="Locales">
<option value="">Invariant Language (Invariant Country)</option>
<option value="af">Afrikaans</option>
<option value="sq">Albanian</option>
<option value="ar">Arabic</option>
<option value="hy">Armenian</option>
<option value="az">Azeri</option>
<option value="eu">Basque</option>
<option value="be">Belarusian</option>
<option value="bg">Bulgarian</option>
...

Ps: in the screenshots above I've used a test version of TheSansMono OpenType by Luc(as) de Groot. This font will be published soon on the LucasFonts website, together with TheSansCondensed OpenType. Typographer Luc(as) de Groot is also known for the Calibri and Consolas fonts in Windows Vista and Microsoft Office 2007.

Labels: , , , ,

» Full Article

  Posted by oVan on Wednesday, May 28, 2008 | PermaLink | 0 comments
Older articles are stored in the archives (see sidebar).