Category: Microsoft

HTML Placeholder not working in IE9 and earlier!!

Recently found this very useful jQuery plugin for fixing placeholder issues in old IE browsers. It seems to cover most scenarios and is very easy to  implement 🙂

https://github.com/mathiasbynens/jquery-placeholder

Just add the script after the jQuery and call

$('input, textarea').placeholder();

You will also need to add the placeholder style in your css.

/* Placeholder fix for IE9 for use with jQuery.placeholder plugin */
 .placeholder { color: #aaa; }

If you are a c# razor person, something like this on your impacted pages will do the trick (assuming you something like

@RenderSection("MyJavaScript", false)

in your layout).

@section MyJavaScript
 {
 <script src="@Url.Content("~/Scripts/jquery.placeholder/jquery.placeholder.js")" type="text/javascript"></script>
 <script>
 $('input, textarea').placeholder();
 </script>
 }

How to reset your Remote desktop user account expiry date on your Azure cloud service

If you have not re-deployed your azure cloud service for a while you might just find that your remote access account has expired. Here is a simple way to push out the expiry date without re-deploying.

  1. Login to the Azure Management Console ( https://manage.windowsazure.com ), navigate to you cloud service and select the configure tab
  2. Download the configuration and save to a local temp area.
  3. Open it up in notepad
  4. Find the setting that looks like
    <ns0:Setting name=”Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration” value=”2013-09-07T23:59:59.0000000+01:00″ />
  5. Just change the year to sometime in the future e.g. 2016 and save.
  6. Then from the same configure page in the Azure management console, upload the config file.
  7. Wait a few minutes while the file is process and voila! you can now log in. Of course you must know the original password and usename you used when you last deployed.

Create a No Hyper-V boot option

There seem to be a number of scenarios where Hyper-V (and it’s many virtual networks and network adapters) can cause problems. My two are running VMware and problems with the Azure emulator with shared cache when debugging in Visual Studio.

To solve this problem you could uninstall the Hyper-V feature, but it’s still important for so many other tasks that this is a real pain.

It is possible to create a simple boot option for Windows 7 and 8 and Windows Server that disables the hypervisor. This is quick and painless, so when you ever need or don’t need Hyper-V, just reboot and select the option you want.

  1. Open a command prompt as Administrator (right-click the start button on the desktop and select ‘Command Prompt (Admin)’
  2. Type
     bcdedit /copy {current} /d "Microsoft Windows 8 - No Hypervisor"

    and press enter.
    This creates a new boot entry identical the the current one.

  3. Type
     bcdedit

    and press enter to list all the boot entries.

  4. Copy the identifier, including curly brackets, for the new boot entry (should be the last in the list)
  5. Now we need to disable the hypervisor on the new entry. Type
     bcdedit /set {the new identifier} hypervisorlaunchtype off

    and press enter.

  6. Now reboot and you will be presented with a nice boot menu option and can choose to boot with or without Hyper-V

Create a Wi-Fi hotspot on your laptop–Windows 8

I wanted to make a hotspot from my unconnected Wi-Fi adapter to allow access to the internet over my  wired Ethernet adapter. Connectify Lite was did not allow me to select my wifi adapter, so gave up and just used the manual method I found described in a very good blog with great instructions here

http://www.nextofwindows.com/how-to-turn-your-windows-8-computer-into-a-wireless-hotspot-access-point/

.Net MVC 3 Logon does not redirect out the box–quick fix!

It seems that the templates for MVC 3 razor are not quite complete. If you attempt to browse to a page where authentication is required, then you will be redirect to the Logon page with a ReturnUrl query string.

Something like:

http://mysite.com/Account/LogOn?ReturnUrl=%2fThePageIWant

That’s great except, out the box, the Logon page does not make use of this and the destination page is not redirected to after a successful login. The fix is easy.

Add the returnUrl route value into the Html.BeginForm method as shown below.

Html.BeginForm("LogOn", "Account", new { returnUrl = Request.QueryString["ReturnUrl"] })

You should already have some code in the controller that does some sanity checking on the returnUrl before doing the redirect. Somthing like:

if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
       && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
{
    return Redirect(returnUrl);
}

Make sure this is after the SetAuthCookie line!

Cool stuff and Tips in Windows 8.1

Many of the new features and enhancement brought in Microsoft Windows 8.1 can easily go unnoticed and unappreciated. Here is a list of new features that I have discovered and think are worthy of a mention and some tips with the functionality. They are not in any particular order, more in the order in which I discover them and or can be arsed to write about them!

I am publishing this now and will update it as new things are discovered, and there are a lot!

NOTE! Some of these things may have been around in previous versions of Windows, but I have only really discovered now!

 Calculator (New)

 

A little thing, but the new calculator looks great and includes a nice converter too. No need to get another converter app.

The Standard and Scientific options have got the usual options

The converter has almost every options you could want.

 Calendar

This has been improved a touch with the inclusion of a new ‘What’s next’ view and more info cycling on the larger tile.

 Reading List

Reading list is a simple new app that helps you collate things that you want to read later. Maybe like this blog!

You can simply add items to your reading list from compatible Apps such as Internet Explorer (Touch version only) by using the ‘Share’ charms menu.

From within ‘Reading List’ a click on the listed article opens the appropriate app and pops itself into a slim panel as shown below.

Shortcut Keys

I posted this before, but included here again! Here are few handy Windows Key shortcut keys I find useful

Windows logo key+ D Go to desktop
Windows logo key+ W Search settings only
Windows logo key+ F Search files only
Windows logo key+ C Show the ‘charms’ menu (the one on the right)
Windows logo key+ Tab Switch between recently used apps and programs (left apps bar)
Windows logo key+ L Lock the screen
Windows logo key+ E Opens windows explorer
Windows logo key+ R Open the Run dialog
Windows logo key+ S Opens the Search everywhere. Also do this by pressing the Windows key and just start typing
Windows logo key+ X This opens the ‘Quick Link’ menu. Very useful for the power users out there.
Windows logo key+ SHIFT + (left or right arrow) Move an app or window from one monitor to the other if you have multiple monitor.

For a full list of Windows 8 shortcuts see http://windows.microsoft.com/en-gb/windows-8/keyboard-shortcuts

 Windows Journal

This is an interesting little app that can be very useful. Unless you have the pro version of Adobe Acrobat this app allows you to mark-up, annotate and generally scribble all over any document or thing you can print. When you first start Windows Journal you are asked if you would like to install the printer driver (Journal Note Writer!), say yes. If you didn’t you can do it later from the menus.

Once your doc is there then you can draw and highlight to your hearts content. Unfortunately it does not have a good variety of export or save options. Although you could print to xps or, if you have a pdf printer driver, to that.

You can send by email with these options too (the best being .mht)

 Maths Input Panel

This is for the Maths student or geeks out there. In word or other apps, it can get extremely fiddly writing complex equations.

This is the Word equation toolbar!!!

This little app could help you if you have touch screen and just want to try and write your formula and have it work out how to make it pretty and in a way that can insert into your lovely document.

Open the app, write your crazy formula and click insert. It’s recognition is not perfect, but it can help. Note, not all apps can take the output from this app. I have only tried word and Windows Live Writer. Live writer did not understand. The output seems to be the same as the Word Equation writer, so after inserting into word, you can continue with the standard tools.