08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

354<br />

CHAPTER 15 ■ ENHANCING THE WEB EXPERIENCE WITH SILVERLIGHT<br />

}<br />

}<br />

return ro;<br />

And this only differentiates between Internet Explorer <strong>and</strong> Firefox. If you are not<br />

writing an Ajax application, but one that uses a non-ubiquitous technology such as CSS<br />

or DHTML, you are left querying the user agent <strong>and</strong> trusting that the server returns an<br />

honest answer. The user agent string is simply a text field that contains what the server<br />

believes the browser that is communicating with it is. It is relatively easy to overwrite, <strong>and</strong><br />

thus, a browser from a mobile device (which doesn’t support CSS) could be spoofed into<br />

thinking that it is Internet Explorer, <strong>and</strong> incompatible data would be delivered to it.<br />

It’s pretty clear that HTML <strong>and</strong> scripting, while incredibly useful, are reaching the<br />

end of their serviceable lives with the growing expectations of users for richer <strong>and</strong> more<br />

dynamic applications. With that in mind, platform vendors have offered a number of<br />

technologies that enhance what HTML can do, with examples being things like Java<br />

applets, ActiveX controls, <strong>and</strong> Flash movies.<br />

A new technology in 2007—<strong>and</strong> one that has a number of unique <strong>and</strong> distinct value<br />

propositions that make it a compelling one—is Microsoft <strong>Silverlight</strong>.<br />

Introducing <strong>Silverlight</strong><br />

In Chapter 8, you looked at Windows Presentation Foundation (WPF) <strong>and</strong> a new technology<br />

that it provides called Extensible Application Markup Language (XAML). This<br />

language allows a UI <strong>and</strong> all its interactions to be defined with simple XML markup tags.<br />

This empowers a separation of design <strong>and</strong> development, so that the designer can become<br />

an integral part of the development process.<br />

In the past, a designer would make a mock-up, or “comp,” of the desired vision for<br />

the web site or application. This might be a set of wireframe drawings, pictures, simple<br />

animations, or scribbles on a piece of paper. The developer would have to take these<br />

visions <strong>and</strong> implement them, constrained by what the technology would permit. The<br />

result was often disappointing for both parties.<br />

With XAML, the designer can use tools (such as the Microsoft Expression suite) to<br />

design the graphics, interactions, animations, <strong>and</strong> media that they desire to have in the<br />

site, <strong>and</strong> the developer can simply take this XAML <strong>and</strong> “activate” it by writing the code<br />

behind it that allows it to be used as an application.<br />

Thus, the designer <strong>and</strong> the developer are working from a common set of artifacts,<br />

allowing next-generation designer-centric experiences to not just be possible, but to be<br />

relatively easy to implement.<br />

<strong>Silverlight</strong> is a plug-in for the browser that renders XAML <strong>and</strong> exposes a programming<br />

model in JavaScript. Thus, web developers have a new suite of tools <strong>and</strong> technologies in<br />

XAML that will allow them to take their sites to the next level of richness, but they still

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!