Exploring the new DevExpress Universal 2013 v13.2 release

Introduction

DevExpress is one of the leading providers of developer components for Microsoft Windows based solutions. In fact, this year they are celebrating their 15 year anniversary as a company. In their latest suite of controls, they have a very large assortment of different controls for a variety of technology platforms, such as:

  • WinForms (120+ Controls)
  • ASP.NET (90+ Controls)
  • ASP.NET MVC (50+ Controls)
  • WPF (80+ Controls)
  • Silverlight (75+ Controls)
  • Windows 8 XAML
  • Reporting
  • Dashboard
  • Document Server
  • XAF Application Framework
  • DevExtreme Mobile

In this review of the 2013 v13.2 release, I will highlight what is new in the respective areas. But first, let’s install the suite.

Installation of the DevExpress Universal 2013 v13.2 suite

DevExpress distribute their components in an installer that provides a very user friendly and streamlined way of setting up your environment. If you simply wants to download a 30 day evolution, just head over to the Free Universal Trial page. That downloads a small web installer, which is a very clean simple a nice looking installer that makes installation a breeze:

DevExpressInstall1DevExpressInstall2DevExpressInstall3DevExpressInstall4    DevExpressInstall5

By the way, that’s a really nice looking installation wizard. If you want to do something similar for Windows Desktop, DevExpress provides that kind of look and feel in their WinForms components.

Windows Forms


Windows Forms still lives on and DevExpress keeps on adding new exciting controls and features to their existing line up. In the 13.2 release these are the new features:

Grid Enhancements

The Grid View is a very competent data grid component that is now getting these exiting additions:

Windows Explorer View

This view will mimic the standard Windows Explore way of displaying items.

WinForms1

Inline Data Editing

By double clicking a row, the inline editing capabilities are enabled:

WinForms2

Web Style Row Editing

This editing style can be used with check boxes, both on line level and column header level in order to easily select single, all or multiple items. WinForms3

ASP.NET


Ribbon Control (Web Forms and MVC)

The ribbon control was introduced in Microsoft Office 2007 and has been a great productivity improvement. Its way of categorizing command is now finally possible in your web page.

ASPNETRibbon1

Spreadsheet Control (Web Forms)

Excel in a web page? Well, this would have been something crazy a coupe of years ago, but now DevExpress has made it possible. Just look at the different formulas you can let the mathematical inclined user select from:

ASPNETSpread1
Spreadsheet Control Overview

ASPNETSpread3
Autosum functions

ASPNETSpread4
Financial functions

ASPNETSpread6
Text functions

ASPNETSpread5
Logical functions

ASPNETSpread7
Date & Time functions

ASPNETSpread8
Lookup and Reference functions

ASPNETSpread9
Math & Trig functions

ASPNETSpread10
More functions

If that isn’t enough, let your users knock themselves out by adding charts to their spreadsheet. Just look at all of these charts they can add:

 

ASPNETSpreadCharts1
Charts overview

ASPNETSpreadCharts2
Column chart types

ASPNETSpreadCharts3
Line chart types

ASPNETSpreadCharts4
Pie chart types

ASPNETSpreadCharts5
Bar chart types

ASPNETSpreadCharts6
Area chart types

ASPNETSpreadCharts7
Scatter chart types

ASPNETSpreadCharts8
Other chart types

This is almost too crazy, your users will love you for this.

Grid Batch Editing (Web Forms and MVC)

With this new addition to the Grid control, multiple changes can be edited client side, and when the user clicks Save Changes, all of the changes will be pushed back to the server in one request. Very handy to minimize the chattiness of your web page.

ASPNETGridBatch1
Grid batch editing

Application Themes (Web Forms and MVC)

Users really likes to personalize the look and feel of their workplace, and with the Application Themes you can let them change the web page, or even the web application to something that’s more of their liking.

ASPNETThemes1
Application themes

Token Box Control (Web Forms and MVC)

This is a very popular control for letting the user select multiple items from a list. It makes it very easy to search for items, as well as remove selected items.

ASPNETTokenBox1

ASPNETTokenBox2

When the user types in the input box, it will do an automatic search and highlight found items.

Custom Color Picker (Web Forms and MVC)

Ever wanted to able to select colors from a color palette? It couldn’t be easier than with this control. It supports custom number of columns, custom palettes and even select a complete custom color from a color picker.

ASPNETColor1
Color picker

ASPNETColor2
Color picker with custom palette

ASPNETColor3
Custom color

 

Form Layout Extension (MVC)

If you ever have been struggling with getting the layout of your controls looking nice, this MVC control will makes it very easy to make a well-designed layout:

ASPNETLayout

Grid Lookup Extension (MVC)

This is a very powerful extension to a drop down control. It essentially lets you display a grid in the drop down, complete with check-boxes for multiple selections and additional data for each item in the data list.

ASPNETGridLookup1

Rating Extension (MVC)

This is a standard rating control that enables you to let the user enter their rating for a particular item based on the familiar 5-start principle.

ASPNETRating1

WPF


Spreadsheet Control

Much like the ASP.NET WebForms version discussed above, this is also a very comprehensive and complete spread sheet control. It has all of the charts and formulas from its ASP.NET sibling, but it also adds some more nice touches.

WPFSpread1
WPF spreadsheet control

WPFSpread4
Formulas

WPFSpread2
Charts

WPFSpread3
Page layout

WPFSpread5
Data sorting

WPFSpread6
View

 

PDF Viewer

With the WPF PDF Viewer control, you can easily add PDF reading capabilities. Functions like Print, Find, Zoom in and out are available.

WPFPDFViewer1

Themes

As with the ASP.NET themes control, this WPF version also allows the user to select a them of their choice:

WPFThemes1

Sparkline Control

To present trending information in a data grid, DevExpress has added the possibility to add a Sparkline control.

WPFSparklines1

You can either add lines:

WPFSparklines2

or areas:

WPFSparklines3

Windows 8 Dialog and Message Box

One thing that Windows Store apps have is the new message box that covers the whole width of the screen. Now you can easily achieve this in your WPF application by using this control:

WPFWindows8MB1

Windows 8

Please see my separate post about the DevExpress Windows 8 XAML controls.

Conclusion

I have found that the DevExpress Universal suite of controls are very professional and slick looking. All of the controls seems to enable you as a developer creating good performing application, whether it’s an ASP.NET based application, a Windows 8 Store App, or a more traditional WinForms, WPF or Silverlight application. Please take the 30 day trial for a spin and see how easy it is to make your users having a great consistent Windows Store app experience.
Disclosure of Material Connection: I received one or more of the products or services
mentioned above for free in the hope that I would mention it on my blog. Regardless, I
only recommend products or services I use personally and believe my readers will enjoy.
I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255:
“Guides Concerning the Use of Endorsements and Testimonials in Advertising.”

Add Windows 8 Hub Tiles to your app using the DevExpress Windows 8 XAML Hub Tiles control

Introduction

This is an additional post to my DevExpress review posted here.  In this post I will focus on how you can add Windows 8 Hub Tiles to your app using DevExpress Windows 8 XAML components.

Windows 8 XAML components

Unless you have been living under a rock for the last 2 years, it will not as a surprise to you that the new uCheckser interface paradigm in the Windows Store Apps is drastically different than the way Windows Desktop application has been looking for the last 20 years or so. DevExpress is now offering a new set of Windows 8 XAML based controls that perfectly falls into the new design language. In this mini review, I will be looking at the Hub Tile Components.

The first thing you will notice when you start Windows 8 is a “sea” of tiles that let you quickly get an overview and status of your most common application and start any of them. DevExpress is offering a new exciting component that lets you very easily mimic the Windows Start Screen; it’s called the Hub Tiles control.

DevExpressHubTiles

Windows 8 Hub Tiles

In this demo I will be walk you through how to create a simple application that will benefit from the DevExpress Hub Tile component. It’s a simple recipe app with static data, but in a real world scenario it would either connect to a web service or at least a local database.

Creating a project

When creating a Windows Store app, DevExpress installs a handful of templates in the Template Gallery that makes the process even simpler.

DevExpressProjWiz1DevExpressProjWiz2 DevExpressProjWiz3

A nice touch is that the template automatically create a MVVM (Model View ViewModel) based project, a paradigm that is very common in XAML based development. DevExpress provides base classes that makes data binding and INotifactionPropertyChanged events easily consumed.

So let’s first create a data source for our Hub Tiles. This is very convenient to do, so you can data bind the visual elements in the tile to some data.

 

Let’s see how we easily can present this data in a Hub Tile.

First, let’s get an overview of the different type of tiles that are available:

  • Slide Hub Tile.
    This is a tile that has 2 sides (front and back). It will slide up the contents of the data that it’s bound to in sequence.
  • Swing Hub Tile.
    This tile also has 2 sides, but it “swings” the content back and forth.
  • Hub Tile.
    A tile that has 2 sides (front and back). It will switch between the 2 sides automatically in sequence.

So let’s pick the Slide Hub Tile and see how we easily can bind it to our data.

 

The result is a Hub Tile that will Slide the images of your recipe up within the tile:

DevExpressResult1 DevExpressResult2

Conclusion

I have found that the DevExpress Windows 8 XAML controls makes it very easy to implement the Windows Store user interface design language into your own application. It abstracts the tedious work of implementing Windows Store user controls functionality yourself.

Please take the 30 day trial a spin and see how easy it is to make your users having a great consistent Windows Store app experience.

 

Disclosure of Material Connection: I received one or more of the products or services
mentioned above for free in the hope that I would mention it on my blog. Regardless, I
only recommend products or services I use personally and believe my readers will enjoy.
I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255:
“Guides Concerning the Use of Endorsements and Testimonials in Advertising.”

Azure Role does not start, Could not load file or assembly ‘System.Web.Mvc, Version=4.0.0.0

The sub title of this post is also; how to do pre-web.config assembly binding for Windows Azure.

So I upgraded my ASP.NET MVC 4 Web Application to MVC 5 and published to my Windows Azure Web Role/Worker Role.

What might a little unusual is that I have my web application and the worker role in the same project/role, since the workload is currently very little. In fact, I have a Web Role that spawn background tasks using classes that inherits from RoleEntryPoint.

After upgrade and publish, my worker role did not start. And even though I had enabled all the logging I could think of, the only error I got was that WaIISHost.exe has crashed with an Exception. No stack trace. Bummer.

 

So I had to remote desktop into one of the roles, firing up DebugView.exe and I deployed. This is what I got:

[3464] Microsoft.WindowsAzure.ServiceRuntime Critical: 201 :
[3464] Role entrypoint could not be created:
[3464] System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
[3464] — System.IO.FileLoadException: Could not load file or assembly ‘System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
[3464] File name: ‘System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
[3464]
[3464] WRN: Assembly binding logging is turned OFF.
[3464] To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
[3464] Note: There is some performance penalty associated with assembly bind failure logging.
[3464] To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
[3464]
[3464] —> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
[3464] at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
[3464] at System.Reflection.RuntimeModule.GetTypes()
[3464] at System.Reflection.Assembly.GetTypes()
[3464] at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
[3464] — End of inner exception stack trace —
[3464] at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
[3464] at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum)
[3464] at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)

Hmm.. thats odd, since when I upgraded to MVC 5, I also has these assembly bindings in my web.config:

<dependentAssembly>
<assemblyIdentity name=”System.Web.Mvc” publicKeyToken=”31BF3856AD364E35″ culture=”neutral”/>
<bindingRedirect oldVersion=”0.0.0.0-5.0.0.0″ newVersion=”5.0.0.0″/>
</dependentAssembly>

So let’s enable Fusion logging. It gave me a little bit more details:

[1988] Microsoft.WindowsAzure.ServiceRuntime Critical: 201 :
[1988] Role entrypoint could not be created:
[1988] System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
[1988] — System.IO.FileLoadException: Could not load file or assembly ‘System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
[1988] File name: ‘System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
[1988]
[1988] Assembly manager loaded from: D:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
[1988] Running under executable F:\base\x64\WaIISHost.exe
[1988] — A detailed error log follows.
[1988]
[1988] === Pre-bind state information ===
[1988] LOG: DisplayName = System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
[1988] (Fully-specified)
[1988] LOG: Appbase = file:///F:/approot/bin
[1988] LOG: Initial PrivatePath = F:\approot\bin
[1988] Calling assembly : Mvc.Mailer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
[1988] ===
[1988] LOG: This bind starts in default load context.
[1988] LOG: Using application configuration file: F:\base\x64\WaIISHost.exe.Config
[1988] LOG: Using host configuration file:
[1988] LOG: Using machine configuration file from D:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
[1988] LOG: Post-policy reference: System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
[1988] LOG: Attempting download of new URL file:///F:/approot/bin/System.Web.Mvc.DLL.
[1988] WRN: Comparing the assembly name resulted in the mismatch: Major Version
[1988] ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
[1988]
[1988] —> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
[1988] at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
[1988] at System.Reflection.RuntimeModule.GetTypes()
[1988] at System.Reflection.Assembly.GetTypes()
[1988] at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
[1988] — End of inner exception stack trace —
[1988] at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetRoleEntryPoint(Assembly entryPointAssembly)
[1988] at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.CreateRoleEntryPoint(RoleType roleTypeEnum)
[1988] at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)

Ok, so now I know which DLL tries to load the older MVC 4 assemblies, but why isn’t my binding taking care of that?

As it turns out, since I am using my combined codebase for the worker role, essentially my Application.Web.dll, the web.config is of course not used when the WaIISHost.exe is loading that assembly. So what I had to do is to create a Application.Web.dll.config in my project root, set it to Content and Copy Always(or Copy If Newer), and copy paste in all my Assemlby Binding elements.

Now, the AZure WAIIHost.exe picks it up correctly, and my role is started correctly.

 

 

 

GUI Merge Tool for Git on Windows

So Git doesn’t come with a GUI based merge tool out of the box, which is fine. It’s rather easy to configure Git to use a visual 3-way diff tool.  Here’s some tips on how to setup a GUI merge tool for Git on Windows.

Which one to choose?

Well, that’s a personal choice. Popular ones for Windows seems to be either kdiff3 or P4V visual client.

Here, I will go through the steps to setup the P4Merge: Visual Merge Tool.

First, download the client from Perforce download page.

Start the setup and select only the “Visual Merge Tool” feature:

Select the Visual Merge Tool feature
Select the Visual Merge Tool feature

After the installation has finished, you will need to configure Git to use it. Open a Git bash and type in these two commands;

git config –global merge.tool p4merge
git config –global mergetool.p4merge.cmd ‘”c:\Program Files\Perforce\p4merge.exe” “$BASE” “$LOCAL” “$REMOTE” “$MERGED”‘

That should do it. You can now do visual merging using:

git mergetool

You can also do visual diffs using:

git difftool

 

How to really uninstall Java 7 JRE on Mac OS X

Thanks to this stupidity from Oracle, I needed to uninstall Java 7 and go back to the Java v6 runtime.

(Hey, Oracle, this bug was reported 9 months ago.)

Well, the official way of  uninstall Java 7 and roll back to v6 from Oracle and Apple didn’t work for me. $ java -version still reported v1.7.

Thanks to Topher Kessler, this way worked for me;

delete the file 1.7.0.jdk located in /Library/Java/JavaVirtualMachines

Delete the v1.7.0.jdk file to uninstall Java 7
Delete the v1.7.0.jdk file

To call this method, the “Membership.Provider” property must be an instance of “ExtendedMembershipProvider”.

Membership Provider property must be an instance of ExtendedMembershipProvider

Have you just created an ASP.NET MVC 4 internet project, decided to use the universal providers to utilize SQL Azure? So you have installed the NuGet package Microsoft ASP.NET Universal Providers and now your project bombs with:

To call this method, the “Membership.Provider” property must be an instance of “ExtendedMembershipProvider”.

You search for a solution, find Jon Galloway article SimpleMembership, Membership Providers, Universal Providers and the new ASP.NET 4.5 Web Forms and ASP.NET MVC 4 templates , where he states: “If you want to use the new AccountController, you’ll either need to use the SimpleMembershipProvider or another valid ExtendedMembershipProvider. This is pretty straightforward.”

Well, he fails to describe what you’ll need to do if you want continue to use the AccountController. Fear not, here’s what you’ll have do to.

Edit your web.config and replace:

<profile defaultProvider=DefaultProfileProvider>
<providers>
  <add name=DefaultProfileProvider” type=System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
connectionStringName=DefaultConnection
applicationName=/ />
  </providers>
</profile>
<membership defaultProvider=DefaultMembershipProvider>
  <providers>
    <add name=DefaultMembershipProvider
type=System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 connectionStringName=DefaultConnection enablePasswordRetrieval=false” enablePasswordReset=true” requiresQuestionAndAnswer=false
requiresUniqueEmail=false” maxInvalidPasswordAttempts=5
minRequiredPasswordLength=6” minRequiredNonalphanumericCharacters=0
passwordAttemptWindow=10
applicationName=/ />
  </providers>
</membership>
<roleManager defaultProvider=DefaultRoleProvider>
  <providers>
    <add name=DefaultRoleProvider type=System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 connectionStringName=DefaultConnection applicationName=/ />
  </providers>
</roleManager>

With:

<profile defaultProvider=SimpleProfileProvider>
  <providers>
    <add name=SimpleProfileProvider type=WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData
        connectionStringName=DefaultConnection applicationName=/ />
</providers>
</profile>
<membership defaultProvider=SimpleMembershipProvider>
  <providers>
      <add name=SimpleMembershipProvider” type=WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData />
  </providers>
</membership>
<roleManager defaultProvider=SimpleRoleProvider>
  <providers>
    <add name=SimpleRoleProvider type=WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData/>
  </providers>
</roleManager>

 

How to save your git password in the Mac OSX keychain

Are you tired of constantly having to enter your Git password all the time? Here’s how to make life much easier for you by saving the git password in the Mac OSX keychain.

In order to not having enter your git based password every time you perform a git operation, here’s how you can store the git password in the Mac OSX keychain:

Check if you have the credential-osxkeychain helper already installed:

git credential-osxkeychain

If not, the download and install it:

curl http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain -o git-credential-osxkeychain
sudo mv git-credential-osxkeychain /usr/local/bin
sudo chmod u+x /usr/local/bin/git-credential-osxkeychain

And make git use the helper:

git config --global credential.helper osxkeychain

 

 

The Local Farm Is Not Accessible. Cmdlets with FeatureDependency are not registered. How to fix this properly

So you have started to administer SharePoint 2010 using a non-farm account. You try to open the SharePoint 2010 Management Shell and you are greeted with this error:

“The Local Farm Is Not Accessible. Cmdlets with FeatureDependency are not registered”

You Bing this error and find a lot of blog posts that suggests you to open SQL Server Manager and give DBO permissions to all the related SharePoint databases; content, config etc.

Please don’t do that.

Here’s the proper way to give your account the needed permissions:

Open the SharePoint 2010 Management Shell with an account that already has farm permissions.

Permission the desired account using:

> add-spshelladmin -username domain\username

That’s the proper way of doing it.

You can also check which accounts has shell admin rights:

>get-spshelladmin

 

Creating iOS and mobile friendly ASP.NET MVC web applications using DevExpress DXperience 12.1

How to make iOS friendly ASP.NET MVC web pages.

Introduction

DevExpress is one of the biggest and well-known companies for delivering tools and components for .NET developers. They have been in the business for almost 15 years and have a proven record of delivering solid solutions for developers. In this post I will be looking at the latest DevExpress ASP.NET components and in particular the new iOS theme for their components that was introduced in the 12.1 release.

What’s installed

When you install the ASP.NET controls, a series of Visual Studio templates are added to your New Project dialog:

Amongst them are a standard Web Application, an Empty Web Application, a Table Web Application and last an Outlook Inspired Web Application. All of them in both classic ASP.NET Web Forms and ASP.NET MVC flavors.

iOS theme

In this review I will be focusing on the brand new iOS theme that’s just added to the latest version. In the DXperience 12.1 package, you’ll get a set of predefined themes that allows you to get your web applications a slick professional appearance from the get go. In addition to the iOS theme, you also get Default, Aqua, Black Glass, Dev Ex, Glass, Office2003Blue/Olive/Silver, Office2010 Black/Blue/Silver, Plastic Blue, Red Wine, Soft Orange and finally Youthful.

One thing you will notice is that all graphical user interface elements are much more enlarged and bigger than what you are used to, all intended to make the visual elements easier to use from a touch enabled device such as an iPhone/iPod/iPad as well as Android and Windows Phone mobile devices.

Device-dependent theme

Although the iOS Theme is great for mobile devices, it can be a bit of over spacious for a normal desktop client. One way to solve this problem is to only use the iOS Theme for mobile devices and switch to a more desktop centric theme for others. This can be accomplished by using the User Agent to detect mobile devices. Most, if not all mobile devices, presents a user agent string that contains the word Mobile in it. For example, an iPad would present something like:

Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; de-de) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5

A Windows Phone would typically use:

Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0)

And finally a generic Android device running Chrome on Ice Cream Sandwich would have this User Agent string:

Mozilla/5.0 (Linux; Android 4.0.4; SGH-I777 Build/Task650 & Ktoonsez AOKP) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19

The one thing they all have in common is the string “mobile”, so that’s what we are going to check on.

In the global.asax.cs file, simply add code for handling the Application_PreRequestHandlerExecute method.

protected

void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
  if (Context.Request.UserAgent.ToLower().Contains(“mobile”))
  {
    DevExpressHelper.Theme = “iOS”;
  }
  else
  {
    DevExpressHelper.Theme = “Office2010Black”;
  }
}

Testing with an iPad device

Let’s first browse to our test page using a desktop browser.

A pretty standard looking desktop theme.

Let’s test with the iOS simulator and see if this works.

As you can see, we now have switch to a much more touch friendly theme for our mobile users, and desktop users will experience a more traditional theme.

Conclusion

Mobile devices are a big expanding market; more and more users are consuming content on their mobile phones and their tablets. It’s important that your public facing web sites are offering the best possible user experience. The new iOS theme from DevExpress will help you accomplish this by enabling your ASP.NET web applications delivering a much more touch-friendly experience.

You can download a free trial of the complete DevExpress DXv2 suite of tools from here.

Disclosure of Material Connection: I received one or more of the products or services mentioned above for free in the hope that I would mention it on my blog. Regardless, I only recommend products or services I use personally and believe my readers will enjoy. I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255: “Guides Concerning the Use of Endorsements and Testimonials in Advertising.”

How to enable automatic Windows Update on Windows Server 2008 R2 Core

It’s important to keep your Windows Server up to date. Here’s how to enable Windows Update on Windows Server Core.

The Windows Server Core product is an excellent server edition for running a Domain Controller in a development setup. One thing to keep in mind is that Windows Update is by default turned off. It’s really a good practice to turn it on to download and install updates automatically. Here I will describe the steps necessary to enable Windows Update on Windows Server Core.

Start sconfig

Screenshot, Windows Update on Windows Server Core
 

 

 

 

 

 

Select option 5) and set it to A) (Automatic updates).

Then it’s a good idea to download and install the latest updates by selecting option 6)