Monthly Archives: June 2007

Adobe AIR Free Book Download

The guys at ajaxian.com had posted a link to the electronic copy of that book. Here is the link to download. Here is also amazon link. The pocket guide covers:

* Introduction to AIR
* Getting Started with AIR development
* Working with JavaScript and HTML within AIR
* AIR Mini Cookbook
* Command line tools
* Aliases

Read source
AIR:Documentation

Updated ASP.NET AJAX Control Toolkit Release and New ASP.NET AJAX Videos/Articles

Scott Guthrie put all these links together! Check them out here, thanks Scott!

Last week the ASP.NET AJAX Control Toolkit team released Build 10618 of the ASP.NET AJAX Control Toolkit. This fixed a few issues discovered with the release earlier this month including:

  • A fix for the Tabs naming container
  • A fix for a VS design-time dependency
  • FilteredTextBox Navigation and control key issues

This build also contains additional performance optimizations for the new “script combining” feature provided by the new ToolkitScriptManager control. This feature can help significantly improve performance for pages with multiple AJAX scripts that previously needed to be downloaded separately. David Anson has a nice blog post that talks about these improvements here.


New ASP.NET AJAX Videos

Joe Stagner has recently posted five new (free) ASP.NET AJAX videos on www.asp.net:

step1 Updated ASP.NET AJAX Control Toolkit Release and New ASP.NET AJAX Videos/Articles

You can download and watch the videos here. These new videos are available to download in a variety of video and audio formats including: WMV, Zune, iPod, PSP, MPEG-4, and 3GP.


New ASP.NET AJAX Articles

Here are a few recent ASP.NET AJAX articles you might also want to check out:

  • ASP.NET AJAX UpdatePanel Tips and Tricks: This is a great MSDN Magazine article by Jeff Prosise that covers: update highlighting, how to cancel updatepanel updates, optimizing with conditional updatepanels, and using page methods.

  • AJAX Control Toolkit Patch Utility: If you are not an official contributor to the ASP.NET AJAX Control Toolkit project, but would like to submit a bug fix or small feature into the toolkit, you can read this article to learn how to create and submit a patch to the team for them to review and potentially include.

read original

Safari 3.0 support of CSS 3.0

Nice post which presents some of the new features that will come with CSS 3.0 and the Safari support of them. In the original post you can find also some demos.

You see, even 3 months ago Safari 3.0 was far out in front of the other major browsers in implementing the incredibly cool features of CSS 3.0, the next generation of the W3C’s Cascading Style Sheets standard. But back in March, that implementation was buried in the open-source WebKit browser framework, which very few Mac users ever use directly, and in the alpha version of Safari 3.0, available only to a few thousand Mac OS X developers.

Suddenly, with last week’s announcement at the Apple developer conference, the latest, greatest, state-of-the-art WebKit framework, with its powerful CSS 3.0 tools, is available to over 95% of the public through the Safari public beta. That being the case, it’s clearly time to get to know the CSS 3.0 features a bit better.

csslogo Safari 3.0 support of CSS 3.0And what features might those be? Well, without writing the whole article in this introduction, here’s a short list of the CSS 3.0 styles that I am most anxious to master:

1. Box-shadow: Yes! Add drop shadows through CSS!
2. Multi-column layout: Can we really do this now? With HTML?
3. Resize: Give JavaScript hacks a rest and let users relax when typing input on web pages.
4. Rounded corners: Any
can be made round.
5. Colors with transparency: There goes another ugly hack from way back!
6. Background image controls: Remember how great it was when you could add images as well as colors to an element’s background CSS style? Well, it’s about to get a whole lot better!

This article lists the CSS 3.0 features that are available today only in Safari 3.0 or the nightly WebKit browser. But I wasn’t content to just list them… I wanted to play around with them as well. So each feature is accompanied by a demo or two and some explanatory notes. Since some of the features are a bit complex, and almost totally lacking in documentation from either W3C (which only lists the standards, not the implementation details), Apple, or the WebKit team, I’ve had to experiment to discover what some of the attributes do.

Fortunately, a forward-thinking group of techno-weenies is keeping a close eye on the emerging details of the CSS 3.0 implementations, and they have done some experimenting of their own. Since they’re in the same boat I am (actually, they have a much better boat!), it’s not surprising that I’m finding ambiguities in the way they’ve built some of their demos. Still, it’s the closest thing to documentation that I’ve found, and I highly recommend that anyone interested in learning more about CSS 3.0 pay a visit to the terrific CSS3.info website. In fact, you’ll find links to their pages throughout this site.

Following CSS3.info’s lead, I’m organizing the (at this time) Safari-specific implementations into four categories: Borders, Background, Text Effects, and User Interface. These correspond to the W3C draft modules for CSS 3.0. The fifth tab in the navigation control below gathers the CSS 3.0 specifications that have been implemented by Safari and at least one other major browser. As you browse through these up-and-coming features, I think you’ll understand my excitement about the benefits they offer to web graphic- and user-interface designers.

Since it’s clear from doing one or two of these that it’s going to take me some time to demo all 7 of the Safari-only features, I’m going to start with what I’ve got today and leave placeholders for the rest. I’ll add the demos as time and energy permits. In the meantime, as mentioned before, do pay a visit to CSS3.info for their demos of each. I hope you’re inspired to take up a keyboard and pound out some experiments of your own!

Before I leave you to the demos, I’m sure some readers are wondering about my statement that Safari 3.0/WebKit is far in the lead in implementing CSS 3.0. Here then are the stats in case you’d like to keep score. Of the 19 CSS3 styles documented by CSS3.info as having been fully or partly implemented by at least one of the major browsers thus far, Safari has done 18 of them:

1. Safari: 18
2. Firefox: 9
3. Opera: 5
4. IE7: 0 (?)

Note: This is only counting browsers that have a publicly released version available, not those that have announced future plans.
read original

VS 2008 JavaScript Intellisense

Taken from Scott Guthrie’s blog, this article show us one of the most wanted new features – JavaScript Intellisense:

One of the features that web developers will really like with VS 2008 is its built-in support for JavaScript intellisense. This is enabled in both the free Visual Web Developer 2008 Express edition as well as in Visual Studio, and makes using JavaScript and building AJAX applications significantly easier.

Below is a quick tour of some of the new JavaScript intellisense features to take advantage of:


JavaScript Type Inference

One of the things you’ll notice immediately when you start typing within a script block is the richer support that Visual Studio 2008 now has for JavaScript keywords and language features:

step1 VS 2008 JavaScript Intellisense

JavaScript is a dynamic language, and doesn’t support explicit type declarations, which has made implementing good intellisense difficult in the past.

Visual Studio 2008 adds support for type inference, which means that it evaluates and computes how a JavaScript block is being used and dynamically infers the variable usage and type information of the code to provide accurate intellisense support.

For example, Visual Studio below will infer that an html element is being retrieved by the document.getElementById() method, and provide appropriate html element intellisense for the variable result:

step2 VS 2008 JavaScript Intellisense

read all

VS 2008 Multi-Targeting Support

Thats valuable, Scott Guthrie is describing how the multi-targeting works into new named VS 2008. The idea is to have the new IDE working with 2.0 framework. Unfortunately 1.1 isnt supported. Here is his post:

Earlier this month at TechEd we announced the official name of Visual Studio “Orcas” – which will be called Visual Studio 2008. We also said that the official name for the .NET Framework “Orcas” release will be called .NET Framework 3.5 (it includes the new LINQ support, integrated ASP.NET AJAX support, new ASP.NET data controls, and more).

VS 2008 and .NET 3.5 Beta 2 will ship later this summer, and the Beta 2 release will support a go-live license for those who want to put applications into production using the new features immediately.
What is Multi-Targeting?

With the past few releases of Visual Studio, each Visual Studio release only supported a specific version of the .NET Framework. For example, VS 2002 only worked with .NET 1.0, VS 2003 only worked with .NET 1.1, and VS 2005 only worked with .NET 2.0.

One of the big changes we are making starting with the VS 2008 release is to support what we call “Multi-Targeting” – which means that Visual Studio will now support targeting multiple versions of the .NET Framework, and developers will be able to start taking advantage of the new features Visual Studio provides without having to always upgrade their existing projects and deployed applications to use a new version of the .NET Framework library.

Now when you open an existing project or create a new one with VS 2008, you can pick which version of the .NET Framework to work with – and the IDE will update its compilers and feature-set to match this. Among other things, this means that features, controls, projects, item-templates, and assembly references that don’t work with that version of the framework will be hidden, and when you build your application you’ll be able to take the compiled output and copy it onto a machine that only has an older version of the .NET Framework installed, and you’ll know that the application will work.

So why use VS 2008 if you aren’t using the new .NET 3.5 features?

You might be wondering: “so what value do I get when using VS 2008 to work on a ASP.NET 2.0 project versus just using my VS 2005 today?” Well, the good news is that you get a ton of tool-specific value with VS 2008 that you’ll be able to take advantage of immediately with your existing projects without having to upgrade your framework/ASP.NET version. A few big tool features in the web development space I think you’ll really like include:

1. JavaScript intellisense
2. Much richer JavaScript debugging
3. Nested ASP.NET master page support at design-time
4. Rich CSS editing and layout support within the WYSIWYG designer
5. Split-view designer support for having both source and design views open on a page at the same time
6. A much faster ASP.NET page designer – with dramatic perf improvements in view-switches between source/design mode
7. Automated .SQL script generation and hosting deployment support for databases on remote servers

You’ll be able to use all of the above features with any version of the .NET Framework – without having to upgrade your project to necessarily target newer framework versions. I’ll be blogging about these features (as well as the great new framework features) over the next few weeks.

What about .NET 1.0 and 1.1?

Unfortunately the VS 2008 multi-targeting support only works with .NET 2.0, .NET 3.0 and .NET 3.5 – and not against older versions of the framework. The reason for this is that there were significant CLR engine changes between .NET 1.x and 2.x that make debugging very difficult to support. In the end the costing of the work to support that was so large and impacted so many parts of Visual Studio that we weren’t able to add 1.1 support in this release.

VS 2008 does run side-by-side, though, with VS 2005, VS 2003, and VS 2002. So it is definitely possible to continue targeting .NET 1.1 projects using VS 2003 on the same machine as VS 2008.

What is compatibility like moving from VS 2005 to VS 2008 and .NET Framework 2.0 to 3.5?

We are trying to make sure that .NET Framework 3.5 is a super compatible upgrade from .NET 2.0, and not require you to change any code in order to target the new framework version. We’ve deliberately made only non-breaking modifications to existing .NET assemblies in the .NET 3.5 release, and where possible added new features in separate assemblies to minimize the chance of breaking changes.

We are also not making project model or build changes with VS 2008. I, like you, hope to never to go through that again! Both the “web site” and “web application project” models will be fully supported going forward.
read original

iPhone Browser Capabilities and Guidelines

iphone2 iPhone Browser Capabilities and Guidelines
Some iPhone browser capabilities and restrictions:

  • 10MB max html size for web page
  • Javascript limited to 5 seconds run time
  • Javascript allocations limited to 10MB
  • 8 documents maximum loaded on the iPhone due to page view limitations
  • Quicktime used for audio and video
  • No Java
  • No Flash

and in features:

  • the page view feature lets you look at multiple websites and documents by scrolling thru them one after another
  • Full PDF support
  • double tap for zoom in
  • one finger as a mouse used to
  • two fingers as a mouse used to
  • new telephone links allows you to integrate phone calls directly from your webpage. remember this is only on safari.
  • built in google maps client for integrated mapping from your website

The best ways to incorporate the benefits of AJAX without making your site blind to search engines

The guys at softwaredeveloper.com posted quite good article showing how not to use cloaking, div layering:

AJAX gives developers the ability to build dynamic web applications without the need for constant server side script parsing, enabling you to provide users with simulated “load on demand” sites. That means shorter page loading times, a sharp decrease in bandwidth consumption and more accessible information in general.

Unfortunately, developers are often so focused on creating a dynamic web page, that they forget that most website traffic today comes through search engines, search engines which have a hard time crawling and indexing the JavaScript in standard AJAX sites. In plain english, that means that in Google’s eyes, many of your AJAX site’s pages are invisible when it comes to search engine ranking. Compounding the problem is the fact that standard AJAX implementations use only a single page or URL for the majority of actions, meaning that not only are your site’s pages indexed poorly, but that your site also has fewer pages in Google’s index.

To help you as you incorporate the benefits of AJAX without making your site blind to search engines, we’ve assembled a guide of the best (and the worst) solutions for creating an AJAX page that maintains the ability to be indexed by Google. Here is our how to guide on getting Google and AJAX to play nice.

The Wrong Approach

The Little Things

AJAX allows you to incorporate a lot of innovative site design characteristics. Some designers take the AJAX craze too far, however, by incorporating AJAX to a degree that it hurts their site’s usability and accessibility. Here are a few of the most common problems.

* Making it too simple. Designing sites where AJAX controls everything and serves content on a single page can be a search engine ranking disaster, as your website will have only one URL for everything. Instead, be sure to offer unique sub-links and URLs for popular site features.
* Disabling browser controls. Since AJAX does not communicate with your browser’s history, simple actions like hitting your browsers back and forward buttons are rendered useless. Although you may not traverse your website via browser buttons, many users do. Make sure you’re not overdoing AJAX so much that users get lost in your website.
* Not using Google’s Webmaster Tools. These tools are a simply and reliable way to keep track of the pages of your website Google is indexing.

Cloaking

If Google cannot read the JavaScript components of your site, an obvious solution is to just provide an alternative readable version for Google, right? Wrong. Engaging in cloaking is a bad approach for making your AJAX website search engine friendly, because it is likely to get your site blacklisted and removed from Google’s index entirely. Cloaking occurs when a developer creates two distinct versions of the same website, with the second version (usually plain HTML/text) only visible to search engine spiders. Spammers have long used the technique to hide popular phrases and links in the invisible content in order to artifically rank better in search engines, and Google has responded by banning these sites. To make sure Google doesn’t confuse your site for one that’s up to no good, make sure your crawlable site is derived from the same site your visitors are seeing.

DHTML Layering

If you’ve read other articles on making AJAX sites search engine friendly, you’ve probable read that you should create DHTML layers of your content. While that solution might be effective for producing an attractive interface, however, it is absolutely the wrong approach to achieving better search engine rankings, as DHTML (typically) requires JavaScript to function properly. So how could it be possible to fix a JavaScript compatibility problem by throwing more JavaScript on it? It’s not. Still not convinced? Try readying Google’s Webmaster Guidelines and check out this case study.

Abandoning AJAX

Perhaps the easiest (read laziest) solution is to just abandon AJAX altogether in favor of server side scripting languages such as PHP or Perl. While these languages are powerful enough to perform virtually every operation, they lack the same interactive feel that AJAX websites produce. Now we’re not saying you should completely avoid using server side scripting languages; however, for front-end pages requiring a lot of simple interaction with the consumer we’re all for AJAX.

The Right Approach

Getting Started

Here are a few general tips you should follow when developing a search engine friendly AJAX website.

* Design your site with degradable AJAX, that way users with JavaScript disabled can view a working version of your website along with JavaScript enabled visitors.
* After you’ve established a non-AJAX working version of your website, go back and include an alternative AJAX enhancements where you desire.
* When designing, make sure to check your website with JavaScript disabled as well as through the eyes of a text only browser such as Lynx or SEO-Browser.
* Perform a browser check to make sure the user has JavaScript enabled, that way you’re only serving AJAX pages to users that can view them.

It is extremely important to follow this methodology for widely used site features such as navigation bars. After all, if the user is unable to traverse the pages of your website, what is the point of offering content?

Hijax

Hijax is potentially the most reliable and resourceful solution for developing an AJAX website that properly renders for every user (JavaScript enabled or not) and is also Google spider friendly. To employ the Hijax model, you’ll need to start off by building a standard website equipped with basic links and server side submission techniques. From there, use JavaScript to intercept those links, submissions and other user interactions and pass the information via XMLHttpRequest. Through this process, your website is able to selectively update individual parts of the page in “real time” without the need for constant reloading. Confused yet? We were too at first, but after following this easy guide everything suddenly became clearer.

Excerpt from Progressive Enhancement with Ajax:

JavaScript pseudo-protocol – AWFUL!
contextual help

Pointless link – BAD!
contextual help

Using the DOM – BETTER.
contextual help

No inline JavaScript – BEST!
contextual help

Noscript

You can generate a degree of search engine recognition for your AJAX webpages by using the noscript element. The noscript element “allows authors to provide alternate content when a script is not executed.” For more information on implementing the noscript technique, check out this informative article.

Sitemap

Now that you have incorporated some of the pro search engine AJAX design recommendations, you can get the ball rolling for your website by submitting a Sitemap index file to Google. Sitemaps allow a “webmaster to inform search engines about URLs on a website that are available for crawling.” Keep in mind simply submitting a sitemap isn’t enough, you’ll need to engange in a combination of the previously mentioned techniques for the best results. For more information check out Sitemaps Wikipedia file.

At this point you should have enough information and resources to build an AJAX enhanced, search engine friendly website. From basic design principles such as incorporating degradable AJAX into your site to utilizing Noscript techniques, you can create an AJAX website that is not only accessible to both JavaScript enabled and disabled users, but also one that will be well-indexed by search engines.
read original

Building Silverlight Applications using .NET

Check that article by Scott, describbing how easily we can build Silverlight applications with dotNet:

I’m just about to hop on the flight back to Seattle after finishing up a 10 day business trip to Europe where I spoke at conferences and user group events in Budapest, Amsterdam and Zurich. Although trips like these are a little exhausting, I find them really valuable as a way to connect with developers from around the world, as well as provide me the opportunity to create and deliver new presentations and samples.

One of the talks I delivered on this trip was a new “Building Silverlight Applications using .NET” talk that people seemed to really like.


Building Silverlight Applications using .NET Talk

I tried to keep the format and samples in this talk simple, and used a model where I used a few slides to explain each programming model concept in Silverlight, and then showed a very simple sample for each concept that helped demonstrate concretely how it worked.

In the talk I covered:

  • XAML
  • Using Shapes and Text
  • Using Controls
  • Layout (Canvas and Layout Managers)
  • Brushes
  • Transforms
  • Handling Events and Writing Code
  • Building Custom UI Controls
  • Reaching out and Programming the HTML of a page from a Silverlight control
  • Handling HTML Events in Managed Code (e.g. html button click handled in C#/VB on the client)
  • Exposing managed APIs to HTML JavaScript in the browser
  • Using the File Open Dialog support
  • Using the HTTP Network APIs
  • Using the Web Service APIs
  • Isolated Storage for local data caching

The slide deck comes to 83 slides – but I think does a good job of explaining everything step by step (it is also an easy deck to read – so even if you don’t want to run the samples locally I’d recommend taking a look through the deck since I think you’ll find it useful). You can download the slides + demos of this talk below:

Included in the .zip download are readme instructions on how to run all of the samples on your own machine.


Quick Answer to a Common Question about .NET with Silverlight

One of the most common questions I received when giving the talk was – “do I need to have the .NET Framework installed in order to use Silverlight?”. The answer to this is no – a cross platform version of the .NET Framework is included in the 4MB Silverlight 1.1 download, which means you do not need to have anything extra installed on the client in order to program Silverlight with a .NET programming model in the browser.

The Silverlight version of the .NET framework includes the same CLR engine (same GC, type-system, JIT engine) that ships with the full .NET Framework, and a subset of the .NET Framework namespace libraries. You can see the full list of all classes/namespaces that are included by opening up the Object Browser when you create a new Silverlight application using Visual Studio (click here for a sample screen-shot of this).

People are usually pretty stunned/confused to hear that it is possible to get this much stuff in so small and quick an install package. Let me just say it wasn’t easy.


Other Silverlight Talks and Blog Posts

For a broader overview talk of Silverlight, as well as some cool (more complete) samples you can download, please check out my previous “Lap Around Silverlight” talk and blog post here. You can learn even more about Silverlight from my summary post here. And you can watch me build a Silverlight application using .NET from scratch in this video here.

The talk above borrowed a number of slides from a few other Silverlight and WPF/E talks that others and I have given (although almost all of the code samples I showed in my talk are new). In particular, my WPF/E talk from earlier in the year, Jamie Cool and Nick Kramer’s Two Talks at MIX, and Stefan Schackow’s Extending the Browser Programming Model with Silverlight talk at MIX. You can watch Jamie, Nick and Stefan’s talks online (along with all of the other MIX talks) for free here.

Creating Packaged ASP.NET Setup Programs with VS 2005

Great article by Scott Guthrie in which he describes how we can create packaged ASP.NET Setup Programs with VS 2005:

Scenario

You have built an ASP.NET Web Application using Visual Studio 2005, and want to enable customers to automatically install and deploy it on servers via an easy setup program.

Specifically, you want to create a standard Windows setup program that will create and configure the application on IIS, copy all of the application’s files to the appropriate location on the server, and ensure that ASP.NET 2.0 is correctly mapped to run the application. You also want the setup program to prompt the customer for the database location that the new application should use, and have the setup program automatically update the web.config file with the database connectionstring settings the customer provided.

One solution to consider using is the built-in “Web Setup Project” support that is built-in to Visual Studio 2005. Web Setup Projects can be used to pipe the compilation outputs from VS 2005 Web Application Projects as well as Web Site Projects (when used with VS 2005 Web Deployment Projects), to create encapsulated Windows setup programs. The below walkthrough demonstrates step-by-step how to create and use one.
read original

Firefox 3: SQLite and more

The guys at ajaxian.com have new interesting post describing the new features in the last Firefox Alpha 5 release. Check it out here:

Firefox 3 is to support SQLite for offline storage. The new alpha release tells us this and a lot more (below).

The world of the RDBMS has come to the browser, and has jumped from server to client in the Web platform.

  • Bookmarks portion of Places has been enabled
  • New crash reporting system, Breakpad. It’s
    enabled by default on Mac OS X, on about 50% of Windows installations, and not yet available on Linux.
    You can also view crash reports at this site.
  • New Javascript-based Password Manager. More details available here.
  • Support for Growl notification under Mac OS X
  • Support for native controls on Mac OS X
  • Miscellaneous Gecko 1.9 bug fixes

read original