BusinessRx Community

Dedicated to the advancement of software, technology and the people who devote their lives to it.

Welcome to BusinessRx Community Sign in | Join | Help
in Search

BusinessRx Reading List

These blog entries are written by industry experts and leaders. We consider this content to be a good read for any software developer or web technologist.

Browse by Tags

All Tags » Atlas » ASP.NET   (RSS)

  • jQuery 1.4.1 Intellisense with Visual Studio

    [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    A few people have emailed me recently asking about the availability of a Visual Studio –vsdoc intellisense hint file for jQuery 1.4.1. 

    I blogged about –vsdoc files in the past – they provide additional intellisense help information for Visual Studio, and enable you to get a richer intellisense experience with dynamic Javascript libraries.  If you are using VS 2008 SP1 you’ll want to download and install this patch in order to have VS 2008 automatically use –vsdoc files with intellisense.  VS 2010 has support for –vsdoc files built-in.

    jQuery 1.4.1 –vsdoc download

    The good news is that you can download –vsdoc files for jQuery directly from the jQuery web-site (look for the “Documentation: Visual Studio” link under each major version).  Here is a direct pointer to the recently released –vsdoc file for jQuery 1.4.1 that you can use.

    Hope this helps,

    Scott

  • Microsoft AJAX CDN – Now with SSL Support

    Back in September I blogged about the new Microsoft AJAX CDN (Content Delivery Network) service that the ASP.NET team is now providing.  The CDN provides edge caching support for AJAX libraries (including jQuery and ASP.NET AJAX).  The service is available for free, does not require any registration, and can be used for both commercial and non-commercial purposes.  It offers a great way to speed up your external facing web-sites.

    SSL Support Now Provided

    One of the features in September that we said was coming (but which was not available at the initial launch) was SSL support for scripts served off of the CDN.  This is necessary for scenarios where you have SSL enabled pages on your site, and you want to reference a script library from the Microsoft CDN and avoid a “This page contains both secure and non-secure items” warning message being displayed to end-users visiting your site.

    SSL support is now enabled with the scripts hosted on the Microsoft AJAX CDN.  Simply use an “https” moniker with any script references on your site that point to the CDN, and they will now be served over SSL.  For example, below is how you can reference jQuery over SSL:

       <script src="https://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>   

    The Microsoft AJAX CDN documentation has recently been updated with more details about it.  You can visit it here to learn more. It lists all of the libraries currently offered via the CDN.  We are steadily adding more libraries to it and will update the page as new ones become available.

    Hope this helps,

    Scott

    P.S. In addition to blogging, I’m also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu

  • Announcing Microsoft Ajax Library (Preview 6) and the Microsoft Ajax Minifier

    The ASP.NET team today released a significant new update of the Microsoft Ajax Library (Preview 6).  This update includes a bunch of new capabilities and improvements to our client-side AJAX library, and can be used with any version of ASP.NET (including ASP.NET 2.0, 3.5 and 4.0), and can be used in both ASP.NET Web Forms and ASP.NET MVC projects.  Today’s release includes the following feature improvements:

    • Better Imperative Syntax: A new, simplified, code syntax for creating client controls.
    • Client Script Loader: A new client-side script loader that can dynamically load all of the JavaScript files required by a client control or library automatically, and executes the scripts in the right order.
    • Better jQuery Integration: All Microsoft Ajax controls are now automatically exposed as jQuery plug-ins.

    In addition to the client library improvements, we also today released a new (free) Microsoft AJAX Minifier tool.  This tool allows you to substantially improve the performance of your websites by reducing the size of your JavaScript files.  It can be run both as a command-line tool, and also ships as a Visual Studio MSBuild task that you can integrate into your VS projects to automatically minify your JavaScript files whenever you do a build.

    Using the Microsoft AJAX Library (Preview 6)

    There are two ways that you can start building applications with the Microsoft Ajax (Preview 6) release:

    1) You can visit the ASP.NET CodePlex website and download the Preview 6 release (which also includes a large set of samples with it).

    2) Alternatively, you can access the Microsoft Ajax Library scripts directly from the Microsoft Ajax Content Delivery Network (CDN).  You can do this by just adding the following script tag to either an .aspx or .html page:

            <script src=”http://ajax.microsoft.com/ajax/beta/0910/Start.js” type=”text/javascript”></script>

    You read my blog post from last month to learn more about the Microsoft AJAX CDN (or visit http://www.asp.net/ajax/cdn).

    Better Imperative Code Syntax with this release

    The ASP.NET team heard feedback from the community that many developers preferred an imperative code approach (as opposed to a declarative syntax approach) when creating client controls. With today’s release we are introducing a simple imperative code syntax for creating client controls and binding them to HTML elements within a page. This syntax is fully supported by the JavaScript Intellisense in both VS 2008 and VS 2010.

    Below is an example of the imperative code you can now write to programmatically create a client-side DataView control that displays data from a WCF web service:

    image

    The above code instantiates a new Microsoft Ajax DataView control and attaches the control to an HTML <div> element with the id “imageView”. The URL of the WCF service is specified with the “dataProvider” property, and the name of the method to call on the service is specified with the “fetchOperation” property.  The “autoFetch” property indicates that the control should automatically bind against the WCF service when it loads.

    Below is what the “imageView” HTML <div> element that the DataView control is attached to looks like.  This <div> contains a template that will be used for displaying each data item retrieved from the service (note: templates were a feature we introduced with an earlier Microsoft Ajax Preview release):

    image

    The {{ Uri }} and {{ Name }} expressions within the template above are replaced with the Name and Uri properties of the images retrieved from the service.  The attribute namespace prefix “sys:src” on the <img> element is used to prevent browsers from attempting to load an image at the actual path {Uri}. The value of the sys:src attribute gets plugged into the src attribute when the template is loaded.

    When the page is rendered in the browser, we then get a simple photo gallery like below:

    image

    Alternatively, if you don’t want to use a declarative binding syntax within a template, you can modify the template to be pure HTML markup like below (no more {{ }} BLOCKED EXPRESSION:

    image

    You can then wire-up and specify a itemRendered event handler when you create the DataView control like below:

    image

    You can then implement the “imageRendered” event handler using the JavaScript below, and use the Sys.bind() method to programmatically assign values to the <img> and <span> tags within the template:

    image

    This allows you to maintain your template as pure HTML markup, while still displaying the same photo gallery experience at runtime.

    Using the Microsoft Ajax Client Script Loader

    The Microsoft AJAX Client-side library is now split up across multiple JavaScript files – allowing you to download and use only those script files that you actually need (reducing download sizes). 

    Manually adding all of the script files required to use Ajax controls can be tedious though (and error prone). To make it easier to use both client controls as well individual client library components, we are introducing a new client script loader with today’s release. This client script loader helps you automatically load all of the scripts required by a control and execute the scripts in the right order when a page loads.

    For example, the following page uses the client script loader to load all of the scripts required by the “watermark” control, and then wires up the watermark control to an <input> textbox:

    image

    Notice the call to the Sys.require() method above. When you call Sys.require(), you supply the name of a client component (or an array of client components) that you want to load. The sys.require() client loader then automatically downloads all of the required script files in parallel (allowing your scripts to load faster and also allow you to avoid blocking the page from rendering).  When all of the scripts required by the components requested are loaded, the Sys.onReady() method is called and the watermark is created.

    Above we are binding the “watermark” control to a <input> textbox with an id of “name”.  At runtime the watermark control will cause the textbox to have a watermark (that automatically disappears when a user sets the focus on the textbox and starts typing):

    clip_image006

    The client script loader supports many advanced features including automatic script combining and lazy loading. It can also be smart about downloading either debug or release versions of libraries. It also allows you to register your own libraries and have them automatically be loaded as well using the Sys.require() syntax.

    Using Microsoft Ajax Library Controls with jQuery

    Microsoft ships jQuery as a standard part of the ASP.NET MVC framework, and also adds it by default to new ASP.NET Web Forms projects created with Visual Studio 2010.

    With today’s preview we are making it easy to integrate jQuery and Microsoft Ajax controls, and enable developers using jQuery to use the Microsoft Ajax controls with a familiar jQuery plug-in API syntax.  Specifically, we are now exposing all Microsoft Ajax controls as jQuery plug-ins automatically. In other words, when you add jQuery to a page, you can use Microsoft Ajax controls just like jQuery plug-ins.

    For example, the following script demonstrates how you can use jQuery to create a DataView that displays data from a WCF service (using a jQuery plugin like code syntax):

    image

    Notice above that I’m loading jQuery by calling the Sys.require() client-side loader API. You can load jQuery using the new client script loader, or alternatively you can just include the jQuery library in the page using a standard <script> tag.

    Once jQuery is added to the page, Microsoft Ajax Library controls are automatically exposed as jQuery plug-ins.  This means you can create and attach Microsoft Ajax controls using a standard jQuery plugin syntax (like above), and fully integrate with the jQuery selector syntax.

    Reducing the Size of JavaScript Files with the Microsoft Ajax Minifier

    There are two common ways that people use to reduce the download size of a JavaScript file: compression and minification.

    When you host your website on a Windows Server using IIS 7.0, you can configure IIS to automatically compress your JavaScript files using GZIP compression – which can provide a significant improvement on performance and the download size of files. However, you can get additional performance benefits by both compressing and minifying your JavaScript files. Steve Sounders describes these additional benefits in his excellent book High Performance Web Sites.

    In addition to releasing Microsoft Ajax Library (Preview 6), we are today also releasing a new (free) Microsoft Ajax Minifier utility that can help reduce the size of your JavaScript files considerably.  It was created by Ron Logon who works on the MSN team. You can download the Microsoft Ajax Minifier from the ASP.NET CodePlex website for free. 

    The following screenshot demonstrates the results of minifying the standard jQuery library using various minification tools such as Douglas Crockford’s JSMin, Dean Edward’s Packer, and the YUI Compressor. The bottom two files were minified using the Microsoft Ajax Minifier utility. Notice that the Microsoft Ajax Minifier has reduced jQuery from 125 KB to only 53 KB.

    image

    The Microsoft Ajax Minifier supports two levels of minification: normal and hypercrunched. When you use normal minification, the Microsoft Ajax Minifier removes all unnecessary whitespace, comments, curly braces, and semi-colons.  When you enable hypercrunching, the Microsoft Ajax Minifier becomes more aggressive in reducing the size of a JavaScript file, and it minifies local variable names and removes unreachable code.

    Here’s a sample of a JavaScript file:

    image

    Here’s what the JavaScript file looks like after it has been minified with the Microsoft Ajax Minifier (with hypercrunching enabled):

    image

    Notice that all unnecessary whitespace has been removed. Notice also that the function parameters firstValue and secondValue have been renamed to b and a.

    The Microsoft Ajax Minifier download includes the following components:

    • ajaxmin.exe – A command-line tool for minifying JavaScript files.
    • ajaxmintask.dll – A MSBuild task for minifying JavaScript files in a Visual Studio project.
    • ajaxmin.dll – A component that you can use in your C# or VB.NET applications to minify JavaScript files.

    After you install the Microsoft Ajax Minifier, you can use the Microsoft Ajax Minifier command-line tool to minify a JavaScript file from a command-prompt. 

    You also have the option of adding the Microsoft Ajax Minifier as a custom MSBuild task to Visual Studio. Adding the Microsoft Ajax Minifier MSBuild task to your Visual Studio project file allows you to automatically minify all of the JavaScript files in your project whenever you perform a build, and enables you to perform minification in an automated way.

    Summary

    Today’s release of the Microsoft Ajax Library has several exciting new features for client-side developers. The new simplified imperative syntax should appeal to JavaScript developers. The client script loader makes it much easier to create client controls and optimize the download of files. And, the jQuery integration enables developers using jQuery to take advantage of the client controls, templating, and data access features of the Microsoft Ajax Library without changing their programming style.

    Finally, the new Microsoft Ajax Minifier enables you to significantly improve the performance of your Ajax applications by reducing the size of your JavaScript files. You can use the minifier from a command prompt or you can use the minifier when building a project in Visual Studio.

    Click here to download both the Microsoft Ajax Library (Preview 6) release and the new Microsoft Ajax Minifier release.

    Hope this helps,

    Scott

    P.S. In addition to blogging, I have recently been using Twitter to-do quick posts and share links. You can follow me on Twitter at: www.twitter.com/scottgu (@scottgu is my twitter name)

  • Announcing the Microsoft AJAX CDN

    Earlier today the ASP.NET team launched a new Microsoft Ajax CDN (Content Delivery Network) service that provides caching support for AJAX libraries (including jQuery and ASP.NET AJAX).  The service is available for free, does not require any registration, and can be used for both commercial and non-commercial purposes.

    What does a CDN provide?

    Content delivery networks (CDNs) are composed of "edge cache" servers that are strategically placed around the world at key Internet network points.  These "edge cache" servers can be used to cache and deliver all types of content – including images, videos, CSS and JavaScript files.

    Using a CDN can significantly improve a website's end-user performance, since it enables browsers to more quickly retrieve and download content.  For example, instead of having a browser request for an image traverse all the way across the Internet to your web server to download, a CDN can instead serve the request directly from a nearby "edge cache" server that might only be a single network hop away from your customer (making it return much faster – which makes your pages load quicker). 

    What does the Microsoft AJAX CDN provide?

    The Microsoft AJAX CDN makes it really easy to add the jQuery and ASP.NET AJAX script libraries to your web sites, and have them be automatically served from one of our thousands of geo-located edge-cache servers around the world. 

    For example, if you want to use jQuery from the Microsoft AJAX CDN then you can simply add a standard script tag to your page using the URL below:

       <script src="http://ajax.microsoft.com/ajax/jquery-1.3.2.min.js" type="text/javascript"></script>   

    When the browser requests the script file it will be automatically served by the CDN "edge cache" server that is closest to the end-user.  This means:

    • The request will be processed much faster than if it had to hit your web-server (making the end-user's page load much faster)
    • You don't have to pay for the bandwidth of this file – since the file comes from our server we pay the bandwidth cost (saving you money)
    • The script can be easily cached across multiple web-sites – which means it might not even need to be downloaded if the user has already hit a web-site that requested the file (and as such has it already in the browser's cache). 

    You can get a full listing of the JavaScript libraries (and associated URLs) we already have loaded in our CDN cache here: www.asp.net/ajax/cdn 

    We'll update the available libraries in the CDN as we ship new versions of ASP.NET AJAX, and continue to update it to include all of the JavaScript files we ship with ASP.NET and Visual Studio (including jQuery, the jQuery Validation plugin, and additional libraries we ship in the future). 

    The CDN service is free and available for anyone in the community to use for both commercial and non-commercial purposes.  You do not need to register to take advantage of it.

    Using the Microsoft AJAX CDN with the ASP.NET 4.0 ScriptManager

    In addition to allowing you to reference script files directly using a <script> element, ASP.NET 4.0 will make it easy to use the CDN from ASP.NET Web Forms applications that use the <asp:scriptmanager/> server control. 

    The ASP.NET 4.0 <asp:ScriptManager> control includes a new property named EnableCdn. When you assign the value true to this property, your application will use the Microsoft CDN to request JavaScript files automatically:

    scriptmanager

    When you enable the CDN with the ScriptManager, your application will retrieve all JavaScript files that it normally retrieves from the System.Web.dll or System.Web.Extensions.dll assemblies from the CDN instead.  This includes both the JavaScript files within ASP.NET AJAX, as well as the built-in Web Forms JavaScript files (for example: the WebUIValidation.js file for client-side validation, and the JavaScript files for controls like TreeView, Menu, etc).

    This provides a nice end-user performance improvement, and means that users accessing your ASP.NET website won’t need to re-download these files if they have visited another ASP.NET website that uses the CDN.

    Using ASP.NET AJAX Preview 5 from the CDN

    In addition to launching the AJAX CDN site, the ASP.NET team has also recently released ASP.NET AJAX Preview 5. You can download ASP.NET AJAX Preview 5 (with sample code) from CodePlex: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=32770

    You can also now use the ASP.NET AJAX libraries simply by adding the following script tags that point at the CDN:

        <script src="http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjax.js" type="text/javascript"></script>

        <script src="http://ajax.microsoft.com/ajax/beta/0909/MicrosoftAjaxTemplates.js" type="text/javascript"></script>

    These script tags reference the beta version of the September 2009 release of the ASP.NET AJAX library (the /0909/ part of the URL represents the year and month that the version of ASP.NET AJAX was released). 

    After you add script tags that reference the ASP.NET AJAX library, you can start using the library in your page. For example, the following code attaches a client DataView control that represents an array of photos to a DIV element in the body of the page.

    data 

    The DIV element – with an id of "photos" – contains a template for formatting each photo in the array of photos. Here’s how the photos element is declared:

    template

    When the DataView is rendered, the contents of the photos DIV element is rendered for each photo in the array of photos. The following photos are displayed:

    photos

    Because ASP.NET AJAX is a pure JavaScript library, the code above works perfectly well in an ASP.NET Web Forms, ASP.NET MVC, HTML, or even with classic Active Server Pages. The code also works with all modern browsers.

    You can learn more about ASP.NET AJAX Preview 5 by downloading the sample code from the CodePlex project:  http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=32770

    Below are several blog posts that delve into the features of ASP.NET AJAX Preview 5 in more depth:

      Summary

      The Microsoft Ajax CDN enables you to significantly improve the performance of ASP.NET Web Forms and ASP.NET MVC applications that use ASP.NET AJAX or jQuery.  The service is available for free, does not require any registration, and can be used for both commercial and non-commercial purposes.

      ASP.NET 4.0 will make it especially easy for ASP.NET Web Forms developers to take advantage of the CDN. By setting one property of the ScriptManager control, you will be able to redirect all requests for the built-in ASP.NET JavaScript files to the CDN and improve the performance of your Web Forms applications.

      Hope this helps,

      Scott

    • May 30th Links: ASP.NET, AJAX, ASP.NET MVC, Visual Studio

      Here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past. 

      You can also now follow me on twitter (@realscottgu) where I also post links and small posts.

      ASP.NET

      AJAX

      • Automatically Minify and Combine JavaScript in Visual Studio: Dave Ward has a great article that describes how you can add a build command to Visual Studio that enables you to automatically compress and combine client-side JavaScript files.  This makes your pages load faster on the client and improves the perceived performance of your sites.

      • Client-side Data Binding in ASP.NET AJAX 4.0: Fritz Onion has a great article about the new client-side templating features of ASP.NET AJAX 4.0 (which you can download and use today in .NET 3.5 projects).  This enables powerful client data-binding scenarios against JSON based data.  Also check out Politian’s Blog to find some great tutorials on how to use it.

      ASP.NET MVC

      • Visual Studio NUnit Templates for ASP.NET MVC: The VS Web Tools team has released updated NUnit templates that work with ASP.NET MVC 1.0.  This enables you to automatically create a test project that uses NUnit instead of MSTest when you do a File->New Project and select the ASP.NET MVC 1.0 Project item.

      • Custom Route Constraints in ASP.NET MVC: Keyvan Nayyeriu has a nice post that discusses how to create a custom route constraint in ASP.NET MVC (one of the extensibility points in Simone’s list above).  You can use these to control whether a route rule is used or not, and they can enable some pretty rich routing scenarios.  Note that in addition to creating route constraint classes, ASP.NET MVC also supports using Regular Expressions and HTTP Method filters to constrain routes as well. Keyvan is the co-author with Simone of the Beginning ASP.NET MVC Book (free chapter available).

      Visual Studio

      Hope this helps,

      Scott

    • jQuery Intellisense in VS 2008

      Last month I blogged about how Microsoft is extending support for jQuery.  Over the last few weeks we've been working with the jQuery team to add great jQuery intellisense support within Visual Studio 2008 and Visual Web Developer 2008 Express (which is free).  This is now available to download and use.

      Steps to Enable jQuery Intellisense in VS 2008

      To enable intellisense completion for jQuery within VS you'll want to follow three steps:

      Step 1: Install VS 2008 SP1

      VS 2008 SP1 adds richer JavaScript intellisense support to Visual Studio, and adds code completion support for a broad range of JavaScript libraries.

      You can download VS 2008 SP1 and Visual Web Developer 2008 Express SP1 here.

      Step 2: Install VS 2008 Patch KB958502 to Support "-vsdoc.js" Intellisense Files

      Two weeks ago we shipped a patch that you can apply to VS 2008 SP1 and VWD 2008 Express SP1 that causes Visual Studio to check for the presence of an optional "-vsdoc.js" file when a JavaScript library is referenced, and if present to use this to drive the JavaScript intellisense engine.

      These annotated "-vsdoc.js" files can include XML comments that provide help documentation for JavaScript methods, as well as additional code intellisense hints for dynamic JavaScript signatures that cannot automatically be inferred.  You can learn more about this patch here.  You can download it for free here.

      Step 3: Download the jQuery-vsdoc.js file

      We've worked with the jQuery team to put together a jQuery-vsdoc.js file that provides help comments and support for JavaScript intellisense on chained jQuery selector methods.  You can download both jQuery and the jQuery-vsdoc file from the official download page on the jQuery.com site:

      Save the jquery-vsdoc.js file next to your jquery.js file in your project (and make sure its naming prefix matches the jquery file name):

      You can then reference the standard jquery file with an html <script/> element like so:

      Or alternatively reference it using the <asp:scriptmanager/> control, or by adding a /// <reference/> comment at the top of a standalone .js file. 

      When you do this VS will now look for a -vsdoc.js file in the same directory as the script file you are referencing, and if found will use it for help and intellisense.  The annotated

      For example, we could use jQuery to make a JSON based get request, and get intellisense for the method (hanging off of $.):

      As well as help/intellisense for the $.getJSON() method's parameters:

       

      The intellisense will continue to work if you nest a callback function within the method call.  For example, we might want to iterate over each JSON object returned from the server:

      And for each of the items we could execute another nested callback function:

      We could use the each callback function to dynamically append a new image to a list (the image src attribute will point to the URL of the returned JSON media image):

      And on each dynamically created image we could wire-up a click event handler so that when it is pressed it will disappear via an animation:

      Notice how the jQuery intellisense works cleanly at each level of our code. 

      JavaScript Intellisense Tips and Tricks

      Jeff King from the Web Tools team wrote up a great post earlier this week that answers a number of common questions about how JavaScript intellisense works with VS 2008.  I highly recommend reading it.

      One trick he talks about which I'll show here is a technique you can use when you want to have JavaScript intellisense work within user-controls/partials (.ascx files).  Often you don't want to include a JavaScript library <script src=""/> reference  within these files, and instead have this live on the master page or content page the user control is used within.  The problem of course when you do this is that by default VS has no way of knowing that this script is available within the user control - and so won't provide intellisense of it for you.

      One way you can enable this is by adding the <script src=""/> element to your user control, but then surround it with a server-side <% if %> block that always evaluates to false at runtime:

      At runtime ASP.NET will never render this script tag (since it is wrapped in an if block that is always false).  However, VS will evaluate the <script/> tag and provide intellisense for it within the user-control.  A useful technique to use for scenarios like the user control one.  Jeff has even more details in his FAQ post as well as his original jQuery intellisense post.  Rick Strahl also has a good post about using jQuery intellisense here.

      More Information

      To learn more about jQuery, I recommend watching Stephen Walther's ASP.NET and jQuery PDC talk. Click here to download his code samples and powerpoint presentation.

      Rick Strahl also has a really nice Introduction to jQuery article that talks about using jQuery with ASP.NET.  Karl Seguin has two nice jQuery primer posts here and here that provide shorter overviews of some of the basics of how to use jQuery. 

      I also highly recommend the jQuery in Action book.

      Hope this helps,

      Scott

    • Nov 6th Links: ASP.NET, ASP.NET AJAX, jQuery, ASP.NET MVC, Silverlight and WPF

      Last week was our big PDC conference, and I've been busy catching up back at work this week.  I'm hoping to publish a bunch of new posts soon (including some on the PDC announcements we made).  Until then, here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past.

      ASP.NET

      • Download Hotfix: False C# Compilation Errors for ASP.NET Code Behind Files with VS 2008 SP1: The C# team added support for live semantic errors with background compilation in VS 2008 SP1.  There were a few cases where this caused false errors to be shown with ASP.NET Web site projects.  You can fix these either by disabling live semantic errors (tools->options allows you to disable this), or by downloading a recent hotfix patch which is now public.  Omar Khan has a useful blog post with more details on it.

      • ASP.NET Patterns Developers Should Know: Alex Homer from the Patterns and Practices (PAG) team at Microsoft has a nice article that introduces a number of common design patterns (MVC and MVP, Repository, Singleton, etc) and how you can apply them within ASP.NET applications.  If you are interested in learning more about pattern based development I also highly recommend reading the Head First Design Patterns book (which has more than 250 positive reviews on Amazon).

      ASP.NET AJAX and jQuery

      • Rich jQuery Intellisense with VS 2008: Last week we published a new jQuery intellisense file for VS 2008 that delivers super-rich and accurate javascript intellisense when using jQuery.  Jeff's article describes how to download and start using it today.

      • ASP.NET and jQuery: Stephen Walther delivered an awesome talk on using jQuery with ASP.NET at the PDC conference last week.  You can now watch it online for free.  Click here to download his code samples and powerpoint presentation.

      • jQuery Primer Part 1 and Part 2: Karl Seguin has two nice posts that provide a quick overview of some of the basics of how to use jQuery.  Also check out Rick Strahl's longer Introduction to jQuery article (which I've previously linked to) for a longer jQuery tutorial.

      • ASP.NET AJAX Futures: Bertrand Le Roy delivered an awesome talk on the new ASP.NET AJAX features coming soon at the PDC conference last week.  You can now watch it online for free as well as download his slides and code-samples.

      ASP.NET MVC

      • Bin Deployable ASP.NET MVC: Phil Haack has a useful blog post that describes step-by-step how to enable \bin directory deployment of ASP.NET MVC.  This enables you to deploy ASP.NET MVC based applications on remote hosting servers that do not have ASP.NET MVC already installed (which means you don't need them to run any setup or do extra steps for your application to work).

      • Donut Caching in ASP.NET MVC: Phil Haack has a great blog post that talks about how to implement substitution output caching with ASP.NET MVC.  I coined the name "donut caching" for this technique with a previous blog post I did on using substitution output caching with ASP.NET Web Forms.  Phil covers it for ASP.NET MVC.

      • Grouping Controllers with ASP.NET MVC: Phil Haack has another great post that covers how to segment a ASP.NET MVC application into multiple "areas" or "modules" - which can optionally be developed in separate projects and merged into one large master application.  Also check out Steve Sanderson's follow-up post with more ideas on this topic.

      Silverlight and WPF

      • Silverlight Toolkit Released: Last week at PDC we shipped the first release of the Silverlight Toolkit.  This is a free download that works with Silverlight 2, and delivers a whole slew of awesome controls and features (including new charting controls, new layout managers, treeview, viewbox, and more).  A must-have download for every Silverlight  developer.

      • Updated WPF Performance Profiling Tool: The WPF team recently posted an update to their excellent WPF Performance Profiling Tool.  Definitely something to check out if you are doing WPF development.

      Hope this helps,

      Scott

    • October 10th Links: ASP.NET, ASP.NET AJAX, jQuery, IIS

      Here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past.

      ASP.NET

      • ASP.NET Dynamic Data Videos using VB: Bill Burrows has put together an awesome series of videos that show off how to use the new ASP.NET Dynamic Data support provided in .NET 3.5 SP1.  You can find more links to ASP.NET Dynamic Data tutorials in my last link post here.

      • Routing with WebForms: Wally McClure has a nice podcast that describes how to use the new ASP.NET routing infrastructure in .NET 3.5 SP1 with Web Forms based pages.  A lot of people mistakenly think this feature only works with ASP.NET MVC applications - when in reality it also works with web forms pages (in fact all ASP.NET Dynamic Data sites use it).

      ASP.NET AJAX and jQuery

      • An Introduction to jQuery (Part 1): Rick Strahl has posted an excellent article that introduces jQuery, and walks-through how to take advantage of it within ASP.NET pages.

      • New AJAX Support for Data-Driven Web Apps: Bertrand Le Roy has written a great MSDN article that describes some of the new ASP.NET AJAX features available in preview form today.  Also check out his blog posts here and here to learn more about how the new client-side data templating feature support.

      • ASP.NET AJAX: Enabling Bookmarking and the Browser's Back Button: Scott Mitchell continues his excellent series on ASP.NET AJAX and discusses how to add history points to an AJAX-enabled web page so that visitors can bookmark it, as well as to enable back/forward browser navigation.  This is a new feature added to ASP.NET in .NET 3.5 SP1.

      Microsoft Web Platform

      Hope this helps,

      Scott

    • jQuery and Microsoft

      jQuery is a lightweight open source JavaScript library (only 15kb in size) that in a relatively short span of time has become one of the most popular libraries on the web.

      A big part of the appeal of jQuery is that it allows you to elegantly (and efficiently) find and manipulate HTML elements with minimum lines of code.  jQuery supports this via a nice "selector" API that allows developers to query for HTML elements, and then apply "commands" to them.  One of the characteristics of jQuery commands is that they can be "chained" together - so that the result of one command can feed into another.  jQuery also includes a built-in set of animation APIs that can be used as commands.  The combination allows you to do some really cool things with only a few keystrokes.

      For example, the below JavaScript uses jQuery to find all <div> elements within a page that have a CSS class of "product", and then animate them to slowly disappear:

      As another example, the JavaScript below uses jQuery to find a specific <table> on the page with an id of "datagrid1", then retrieves every other <tr> row within the datagrid, and sets those <tr> elements to have a CSS class of "even" - which could be used to alternate the background color of each row:

      [Note: both of these samples were adapted from code snippets in the excellent jQuery in Action book]

      Providing the ability to perform selection and animation operations like above is something that a lot of developers have asked us to add to ASP.NET AJAX, and this support was something we listed as a proposed feature in the ASP.NET AJAX Roadmap we published a few months ago.  As the team started to investigate building it, though, they quickly realized that the jQuery support for these scenarios is already excellent, and that there is a huge ecosystem and community built up around it already.  The jQuery library also works well on the same page with ASP.NET AJAX and the ASP.NET AJAX Control Toolkit.

      Rather than duplicate functionality, we thought, wouldn't it be great to just use jQuery as-is, and add it as a standard, supported, library in VS/ASP.NET, and then focus our energy building new features that took advantage of it?  We sent mail the jQuery team to gauge their interest in this, and quickly heard back that they thought that it sounded like an interesting idea too.

      Supporting jQuery

      I'm excited today to announce that Microsoft will be shipping jQuery with Visual Studio going forward.  We will distribute the jQuery JavaScript library as-is, and will not be forking or changing the source from the main jQuery branch.  The files will continue to use and ship under the existing jQuery MIT license.

      We will also distribute intellisense-annotated versions that provide great Visual Studio intellisense and help-integration at design-time.  For example:

      and with a chained command:

      The jQuery intellisense annotation support will be available as a free web-download in a few weeks (and will work great with VS 2008 SP1 and the free Visual Web Developer 2008 Express SP1).  The new ASP.NET MVC download will also distribute it, and add the jQuery library by default to all new projects.

      We will also extend Microsoft product support to jQuery beginning later this year, which will enable developers and enterprises to call and open jQuery support cases 24x7 with Microsoft PSS.

      Going forward we'll use jQuery as one of the libraries used to implement higher-level controls in the ASP.NET AJAX Control Toolkit, as well as to implement new Ajax server-side helper methods for ASP.NET MVC.  New features we add to ASP.NET AJAX (like the new client template support) will be designed to integrate nicely with jQuery as well. 

      We also plan to contribute tests, bug fixes, and patches back to the jQuery open source project.  These will all go through the standard jQuery patch review process.

      Summary

      We are really excited to be able to partner with the jQuery team on this.  jQuery is a fantastic library, and something we think can really benefit ASP.NET and ASP.NET AJAX developers.  We are looking forward to having it work great with Visual Studio and ASP.NET, and to help bring it to an even larger set of developers.

      For more details on today's announcement, please check out John Resig's post on the jQuery team blog.  Scott Hanselman is also about to post a nice tutorial that shows off integrating jQuery with ASP.NET AJAX (including the new client templating engine) as well as ADO.NET Data Services (which shipped in .NET 3.5 SP1 and was previously code-named "Astoria").

      Hope this helps,

      Scott

    • May 20th Links: ASP.NET, ASP.NET AJAX, .NET, Visual Studio, Silverlight, WPF

      Apologies for the sparseness of my posting the last few weeks - work and life have been busy here lately.  Below is a new post in my link-listing series to help kick things up a little.  Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past.

      ASP.NET

      • ASP.NET Perf Issue: Large numbers of application-restarts due to virus scanners: Tess Ferrandez has a great post that details a debug session to determine why an ASP.NET application was restarting frequently (causing performance slowdowns).  The issue was a virus scanner that was causing files to be constantly updated.  Make sure to check out the logging code you can add to your application to identify restart causes like this.

      ASP.NET AJAX

      .NET

      • 7 Ways to Simplify your code with LINQ: Igor Ostrovsky has a great blog post that talks about new code techniques you can use to improve your code using .NET 3.5 and the new language and LINQ features in it.

      • Visual LINQ Query Builder for LINQ to SQL: Mitsu Furuta has created a cool Visual Studio designer that allows you to graphically construct LINQ to SQL queries.  Also make sure to download download the latest LINQPad utility - which is invaluable for learning LINQ and trying out LINQ queries.

      • Ukadc.Diagnostics: Josh Twist pointed me at a new CodePlex project he is working on that extends the System.Diagnostics features in .NET to include richer logging features (SQL trace support, email support, etc).

      Visual Studio

      Silverlight

      • Silverlight 2 Pie Chart: Peter McGrattan has posted a nice control and article that demonstrates how to use a new Silverlight charting control he has written.

      WPF

      • WPF week on Channel9: Watch 6 great videos on Channel9.  Each one includes interviews and demos with members of the WPF team talking about some of the awesome work that went into WPF 3.5 SP1 (read my blog post here for a summary of some of it).

      • WPF Testing and Application Quality Guide: Check out the 0.2 release of a free online book being developed by Microsoft that covers how to test WPF applications.  Definitely worth book-marking if you are doing WPF development.

      • WPF 3.5 SP1 StringFormat: Lester has a nice post that describes how to use the new StringFormat feature in WPF 3.5 SP1.  This makes it much easier to handle formatting of databound values.

      Hope this helps,

      Scott

    • April 28th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Silverlight

      Here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page and Silverlight Tutorials page for links to popular articles I've done myself in the past.

      ASP.NET

      • Displaying the Number of Active Users on an ASP.NET Site: Scott Mitchell continues his excellent series on ASP.NET's membership, roles, and profile support.  In this article he discusses how to use ASP.NET's Membership features to estimate and display the number of active users currently visiting a site.

      • ASP.NET Dynamic Data Update: The ASP.NET team last week released an update of the new ASP.NET Dynamic Data feature.  This update adds several new features including cleaner URL support using the same URL routing feature that ASP.NET MVC uses, as well as better confirmation, foreign-key, and template support. 

      ASP.NET AJAX

      • ASP.NET AJAX UI Templates: Nikhil Kothari from the ASP.NET team has a cool post that shows off a prototype he has been working on that enables clean client-side AJAX templating of UI. 

      ASP.NET MVC

      • Inversion of Control, ASP.NET MVC and Unit Testing: Fredrik Kalseth has a cool article that talks about the concepts behind inversion of control (IOC) and how you can use this with ASP.NET MVC to better isolate dependencies and enable better unit testing of your code.

      Silverlight

      • Silverlight - the Song: Spike Xavier and Dan Wahlin have posted another of their unique and special songs. :-)

      Hope this helps,

      Scott

    • March 28th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, Silverlight, .NET

      Here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page for links to popular articles I've done myself in the past.

      ASP.NET

      ASP.NET AJAX

      ASP.NET MVC

      • Kigg - Building a Digg Clone with ASP.NET MVC: Kazi Manzur Rashid published an excellent Digg-clone sample built with ASP.NET MVC last February.  He recently updated the code to work with ASP.NET MVC Preview 2 (full details here).  You can download the latest version of his source code here.

      • Testing with the ASP.NET MVC Framework: Simone Chiaretta has a great article that discusses how to test controllers using ASP.NET MVC Preview 2.  Note: the next ASP.NET MVC preview release will include a number of refactorings that will simplify controller testing considerably (and avoid the need to mock anything for common scenarios).

      Visual Studio

      • VS 2008 Web Deployment Hot-Fix Roll-Up Now Available for non-English Languages: Last month we shipped a hot-fix release that fixes a number of bugs, adds a few features, and improves performance for web development scenarios in VS 2008 and Visual Web Developer 2008 Express.  Last month's release only worked with the English-language VS 2008 products.  Yesterday we shipped an update that now works for all VS 2008 languages except Portuguese and Russian (which are still to come in the future). 

      • Hotfix Available for VB Performance Issue in VS 2008: The Visual Basic team recently released a hotfix as well that addresses a performance issue with large files that contain XML documentation.  Read this post to learn more about how to download it if you are running into this issue.

      Silverlight

      • Using Silverlight 2's DataGrid with WCF + LINQ to SQL: This 15 minute video blog demonstrates how to build a LINQ to SQL object model on the server and publish it using WCF.  It then demonstrates how to build a Silverlight client that uses the new Silverlight DataGrid control, and which calls the WCF service to retrieve the LINQ to SQL data to populate it with.

      • Simple Editing of Web Service Data in a DataGrid: Mike Taulty has a nice blog post that shows how to create a WCF service on the server, and then use it from a Silverlight 2 client to retrieve data, bind it to a DataGrid, allow users to update rows, add/delete rows, and then save it back to the server using Silverlight 2 Beta1.

      • Sorting with Silverlight 2's DataGrid Control: The DataGrid control in Silverlight 2 Beta1 doesn't yet have built-in column sorting support (it is coming in Beta2).  That hasn't stopped Matt Berseth though!  In this post he shows how to implement sorting using a custom header column approach.  Also check out Matt's post here, which provides a DataGrid test page that shows off a number of the current DataGrid features.

      • Open Source Silverlight Charts with VisiFire: Silverlight doesn't yet have built-in charting controls.  The good news is that the folks at Webyog just released a really cool set of open source Silverlight charting controls (complete with animation support) that enable you to easily build great looking charts.  Their model makes it super easy to use the chart components within existing HTML or AJAX applications.

      .NET

      • FormatWith and DateTime Extension Methods: James Newton-King and Fredrik Kalseth have some nice posts and samples that demonstrate how to use the new extension method feature in the VB and C# languages in VS 2008 to create some useful convenience libraries. 

      Hope this helps,

      Scott

    • March 14th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC and .NET

      I'm slowly recovering from keynoting at MIX last week, and have been digging my way out of backlogged email the last few days.  I'm going to try and finish catching up on blog comments this weekend - apologies for the delay in getting back to some of your questions.

      To kick-start my blogging again I thought I'd post a new link-listing series.  Today's post is mostly focused on ASP.NET and web related links.  I'm going to be doing more Silverlight and WPF posts soon.

      ASP.NET

      ASP.NET AJAX

      • New ASP.NET AJAX Control Toolkit Release: David Anson blogs about a new ASP.NET AJAX Control Toolkit release that the team made right before MIX.  This release includes a number of patches (including a bunch from the community) with bug fixes and improvements in a bunch of areas.

      ASP.NET MVC

      • Thoughts on ASP.NET MVC Preview 2 and Beyond: Phil Haack from the ASP.NET team has a great post where he talks about the ASP.NET MVC Preview 2 release, as well as some of the features and work that will show up in the next preview drop.  One of the major focuses in Preview 3 will be improvements to the testing workflow of controllers.

      • Cheesy Northwind Sample Code: Scott Hanselman has posted a sample application that shows building a simple data driven application using the ASP.NET MVC Framework and the Northwind sample database.

      • Securing Your Controller Actions: Rob Conery shows how to use the new ASP.NET MVC ActionFilterAttribute feature to apply declarative security rules to a controller.  Also check out David Hayden's post here for more security attribute examples.

      • Url Routing Debugger: Phil Haack posts a cool Url Routing Debugger he has built that demonstrates an easy way to test URL route conditions using the ASP.NET MVC framework.

      • ASP.NET MVC Test Project Integration with NUnit and Rhino Mocks: Joe Cartano from the VS Web Tools team walks-through using some NUnit and Rhino Mocks project templates that he has created.  These plug-into the new VS 2008 tools support for ASP.NET MVC, and enable you to easily get a test project started when you create a new ASP.NET MVC application.

      .NET

      • Graffiti: The folks at Telligent have recently released a sweet new CMS system for ASP.NET that is trivial to setup, and which provides a bunch of great content editing support.  Definitely worth looking at if you are in the market for an great way to publish or manage content on the web.

      • Beta of LINQ to LLBLGen Pro Released: Frans Bouma announces the first public beta release of LINQ to LLBLGen Pro (a very popular commercial ORM for .NET).  Frans has a very in-depth 14 post series that discusses how he built the LINQ support for it (a nice technical read).

      Hope this helps,

      Scott

    • Feb 17th Links: ASP.NET, ASP.NET AJAX, Visual Studio, .NET

      Here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page for links to popular articles I've done myself in the past.

      ASP.NET

      ASP.NET AJAX

      • ASP.NET AJAX History Tutorials: Jonathan Carter has published a good series of tutorials that demonstrate how to use the new ASP.NET AJAX History support that we'll be shipping later this year (it is currently available in the ASP.NET Extensions CTP download).  This enables you to add forward/back button navigation support within AJAX applications.

      • Using JQuery with VS 2008 JavaScript Intellisense: One of the improvements we shipped in our recent VS 2008 Hotfix Roll-Up last week was to address issues with JavaScript intellisense support for JQuery (another popular AJAX framework).  Brennan Stehling, James Hart, and Lance Fisher have done blog posts recently that discuss how to enable even richer JQuery intellisense inside VS 2008 using intellisense-friendly JQuery libraries that are referenced while coding (and then swapped out for the real library at runtime).  You can read their blog posts about how this works here and here and here.

      • ASP.NET MVC Tip: Submitting an AJAX Form with JQuery: While on the subject of JQuery, I thought I'd link to a post in Mike Bosch's ASP.NET MVC series that shows how you can integrate JQuery in the browser on the client with the ASP.NET MVC framework on the server.

      Visual Studio

      • Visual Studio Programmer Themes Gallery: Visual Studio enables you to customize the color settings of the text editor and IDE, as well as to export and import the settings (use the Tools->Import and Export Settings menu to do this).  Scott Hanselman has a great post that provides previews of a bunch of cool pre-built themes that people have published that you can download and use for free.

      • Code Profiler Analysis in VS 2008: Maarten Balliauw has a nice post that describes how to use the code profiling features in the Developer edition of Visual Studio Team System to analyze code performance.

      .NET

      • Using the Expression Tree Visualizer: Charlie Calvert has a nice post that talks about one of the very useful debugging tools in the LINQ samples package provided with VS 2008.  It enables you to easily visualize expression tree variables within the debugger - which can be incredibly useful when you are trying to write your own custom LINQ provider (like the ones above).  To learn more about Expression Trees and some of the underlying concepts that make LINQ possible, also check out Charlie's earlier post on them here.

      Hope this helps,

      Scott

    • Feb 6th Links: ASP.NET, ASP.NET AJAX, Visual Studio, .NET, WPF

      Here is the latest in my link-listing series.  Also check out my ASP.NET Tips, Tricks and Tutorials page for links to popular articles I've done myself in the past.

      ASP.NET

      • .NET Debugging Demos Lab: Tess Ferrandez, who is an ASP.NET escalation engineer for Microsoft support and who also posts incredible articles on the art of debugging production ASP.NET applications, has started a new tutorial series that provides a sample "buggy" application and a series of questions/problems you can work through to learn how to debug problem applications in production environments.
      • 4 Alternative View Engines for ASP.NET MVC: The open source MvcContrib project has been adding lots of cool goodness on top of the ASP.NET MVC Framework.  Jeffrey Palermo posts about 4 alternative view rendering engines now in the project that you can use if you don't want to use the default .aspx based view engine.  BTW - I'll be doing a new post on ASP.NET MVC within the next week talking about some of the cool new features coming soon with the next refresh. 

      ASP.NET AJAX

      • Boost ASP.NET Performance with Deferred Content Loading: Dave Ward continues his great articles on ASP.NET AJAX.  This article talks about how you can improve the perceived load-time of a page by using an AJAX callback to retrieve HTML content once the page loads on the client.  This approach is similar to the one I wrote about in my tip/trick post here.

      Visual Studio

      • Visual Studio 2008 Product Comparison: Several people have sent me email in the past asking for a page that describes the differences between the various Visual Studio 2008 editions (Standard, Professional, Visual Studio Team System, etc).  This link is useful to bookmark if you want to learn more about this.
      • Did you know...You can Shift+ESC to close a tool window: Sara Ford continues her excellent "Did you know..." VS 2008 tips and tricks series.  I confess I didn't know this one.  One productivity tip I always recommend is to really learn the keyboard shortcuts of your development tool environment well - since using them over time can yield significant productivity savings.  Click here to download a VB 2008 key bindings poster, or click here to download the C# 2008 key bindings poster equivalent.  Print them out and put them under your pillow to absorb them while you sleep.

      .NET

      • The Power of Yield: Joshua Flanagan has a nice article on one of the coolest, yet underused, feature of C# in .NET 2.0 - which is the yield keyword.  This is a very powerful feature that enables you to efficiently work with IEnumerable scenarios and enable deferred iteration (LINQ leverages this heavily with .NET 3.5).  To master C# even more, I also highly recommend the new C# 3.0 In a Nutshell book (I posted a 5 star review of it on Amazon).

      WPF

      • Making VS 2008 Open in XAML Mode By Default: Matthias Shapiro has a nice post that shows how you can configure VS 2008 to by default load WPF files in XAML mode instead of design-mode.  A very useful shortcut if your natural inclination is to work directly with XAML markup.
      • How can I debug WPF bindings? Beatriz Costa from the Microsoft WPF team has a great post that talks about tips/tricks you can use to better identify "what went wrong" when a databinding expression fails with WPF.
      • Programming WPF and Windows Presentation Foundation Unleashed: If you would like to learn WPF (especially now that there is project and designer support for it in VS 2008), I recommend these two books by Chris Sells and Adam Nathan.  Both are excellent resources to use to learn from.

      Hope this helps,

      Scott

    More Posts Next page »

    This Blog

    Syndication

    Powered by Community Server, by Telligent Systems
    '