The name ‘DisplayModes’ does not exist in the current context

The name ‘DisplayModes’ does not exist in the current context

The error above is caused from the following code:

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    DisplayModes.RequireConsistentDisplayMode = true;
}

Solution:

Replace

DisplayModes.RequireConsistentDisplayMode = true;

with

DisplayModeProvider.Instance.RequireConsistentDisplayMode = true;

Did my solution solve your problem? Leave a reply.

Tips & Tricks – create sitemap automatically

To create automatically an updated site map (or sitemap) of your website I suggest you to use the

Sitemaps Generator

XML Sitemaps Generator | XML-Sitemas.com
Create your Google Sitemap Online – XML Sitemaps Generator

Services:

  • Free Online Generator (Maximum 500 pages)
  • Unlimited Generator (No limits)
  • Online PRO Service

To use the online Free Service, you need to enter some simple details:

  1. the full http address for your site
  2. change frequency
  3. last modification (if you don’t know use “Use server’s response”)
  4. priority (if you don’t know use “Automatically Calculated Priority”)

Then Start. Maximum 500 pages will be indexed in sitemap.

With the Free service, after process, you can download the following formats:

  • un-compressed XML (.xml)
  • compressed XML (.xml.gz)
  • HTML (.html)
  • in Text Format (urllist.txt)
  • ROR (ror.xml)

With the Payment Services you can generate any kind of Sitemap you require:

  • XML
  • HTML
  • Images
  • Video
  • News
  • Text formatted
  • Mobile

Do you think that my Tip & Trick is useful? Leave a reply.

HOW TO disable mobile theme for Twenty Eleven

In Dashboard -> Appearance -> Editor
select the file HEADER (header.php), remove the following line

<meta name="viewport" content="width=device-width" />

then click Update File.

My experience:
Rather to disable the mobile theme support I suggest to to use an optimized mobile theme, now you can active it using the following plugin:

Jetpack by WordPress.com

Did my HOW TO help you? Leave a reply.

HOW TO run Android Apps on Windows or Mac

Yes, now it’s possible to install and run Android Apps on Windows or Mac.

You can download the freeware BlueStacks from the official website:

BlueStacks

Did my HOW TO help you? Leave a reply.

Silverlight for Windows Phone Project Template missing

Windows Phone SDK 7.1 automatically installs Microsoft Visual Studio 2010 Express edition.
If you have installed another edition of Microsoft Visual Studio 2010 you can also use this to create Windows Phone Projects.
Microsoft Visual Studio 2010 Express edition and the other editions are stored in the same Program Files folder “Microsoft Visual Studio 10.0”.

Cause:

Silverlight for Windows Phone Project Template is installed but in another language so when you try to create a new Project with the other Microsoft Visual Studio 2010 edition (NOT EXPRESS) the Silverlight for Windows Phone value into the Installed Templates list is missing.

Solution 1:

Uninstall Windows Phone SDK and reinstall it in the same language of the other Microsoft Visual Studio 2010 edition.

Solution 2 (UNDER THE HOOD):

Follow these Steps:

  1. Understand Microsoft Locale ID Values, it’s a table with correspondence between Language and Local ID.
  2. Store the Local ID value of your other Microsoft Visual Studio 2010 (NOT EXPRESS) editions languages.
  3. Go under <Visual Studio Install Path>\\Common7\\IDE\\ProjectTemplates\\<Language>\\Silverlight for Windows Phone\\
    for example:

    C:\\Program Files\\Microsoft Visual Studio 10.0\\Common7\\IDE\\ProjectTemplates\\CSharp\\Silverlight for Windows Phone
    
  4. Copy and paste the folder inside “Silverlight for Windows Phone” (for example: “1033”) and rename it with the other Local ID (stored at the Step 2).
  5. Repeat Steps 3-4 for each language you’ll use.
  6. Close all Microsoft Visual Studio 2010 running instances.
  7. Run a Command Prompt Window “as Administrator” and enter the following command (devenv is located in <Visual Studio Install Path>\\Common7\\IDE\\):
    devenv /InstallVSTemplates

    this operation, that registers the installed templates, may take several minutes.

Now you can create your Windows Phone Project with all your Microsoft Visual Studio 2010 editions.

NOTE:
If my solutions not work you can try to run the following command:

devenv /ResetSkipPkgs

that clears all SkipLoading tags added to VSPackages.

References:
Devenv Command Line Switches

Did my solution solve your problem? Leave a reply.