-
Testing Sites Against IE 6, IE 7, and IE 8 (beta 2)
-
Microsoft has updated the Virtual PC hard disk images that let you view your sites in IE 6, IE 7, and IE 8. This is handy for scenarios like mine where a client's Web application officially supports only IE 6 but I want the latest and greatest on my own machine.
Internet Explorer Application Compatibility VPC Image:
http://www.microsoft.com/downloads/details.aspx?FamilyID=21eabb90-958f-4b64-b5f1-73d0a413c8ef&DisplayLang=en#filelist
Note: The VPC images expire in January, 2009.
Ken
-
Using the Silverlight Server Control in ASP.NET Pages
-
Microsoft makes available server controls that help you insert rich media such as Silverlight into your ASP.NET pages. If you’re confused about where to find the latest version of these controls, you’re in good company! Pre-release versions have appeared with various Community Technical Previews (CTP), ASP.NET Futures, and ASP.NET Extensions.
The code is now (at this hour, anyway) part of the Silverlight 2 Software Development Kit, a free download.
You need to download the full Silverlight SDK even though you only need a small part of it for use in ASP.NET page. Follow these steps to locate the required file and install it on your computer:
- Browse to http://www.microsoft.com/downloads/.
- In the Search box, enter Silverlight 2 Software Development Kit and click Go.
- From the list of results, download the latest version of the SDK to a temporary directory on your hard drive.
- Using Windows Explorer, double-click the downloaded file (probably named silverlight_sdk.exe) and follow the installation steps to install the complete contents of the SDK.
For a quick introduction to using the Silverlight server control in ASP.NET and Visual Web Developer 2008 Express, you can view a PDF that I've created as an update to my book ASP.NET 3.5 For Dummies:
http://www.kencox.ca/samplecode/Embedding Silverlight in ASPNET.pdf
Ken
-
Enabling JavaScript IntelliSense in External Libraries
-
To get JavaScript IntelliSense working in VS 2008 SP1, you need to tell IntelliSense the location of the libraries that you're using. You do that by adding a special comment at the top of the .js file. It's three slashes followed by the reference in an XML element syntax.
For example, my JScript.js file has a dependency on the jQuery library. So, here's what I add to the top of JScript.js:
/// <reference path="jquery-1.2.6.js" />
IntelliSense then parses the referenced file. Just start typing and you start seeing the jQuery members:
I'm not sure whether it's required to put the reference pointer at the very top of the page but my IntelliSense failed to work when I included comments *before* the reference. The following didn't work:
/*--------------------------------------------------------------------
Don't do this!!!!!!!!!!!!
--------------------------------------------------------------------*/
/// <reference path="jquery-1.2.6.js" />
If the developer of a library wants to provide even more info, IntelliSense will pick that up too. Just use the three-slash comments with the following syntax:
trim: function(text)
{
/// <summary>Removes whitespace from the beginning and end</summary>
/// <param name="text">The string to be trimmed</param>
/// <returns>string</returns>
return (text || "").replace(/^\s+|\s+$/g, "");
},
Here's how the summary appears in the IDE for the trim() function above:
With IntelliSense, JavaScript debugging, and enhanced JavaScript formatting, I may start to hate JavaScript just a little less! <grin>
Ken
-
Visual Studio 2008 SP1 Adds JavaScript Formatting
-
Just a "two thumbs up" for the addition of JavaScript™/JScript® formatting in Visual Studio 2008 Service Pack 1. I don't like leaving messy-looking code - especially since JavaScript makes the trip all the way to the client.
My formatting preference is to show opening and closing braces on a new line, so here's what you need to do in VS 2008:
- From the Tools menu, click Options.
- In the Options dialogue box, check Show All Settings in the bottom left corner. (BTW, it makes no sense for Microsoft to hide so many excellent tools.)
- Expand the Text Editor node, expand JScript and select Formatting.
- In the New Lines group box, check both Place Open Brace On New Line For Functions and Place Open Brace On New Line For Control Blocks.
- Click OK to close the Options dialogue box.
- In a .js page, press Ctrl+K, Ctrl+D (or, From the Edit menu, click Format Document).
This is one of those productivity improvements that makes the IDE indispensable.
Ken