| DotNetKicks.com Links |
| Site Map in ASP.NET 3.5 ... This sample shows how to use a Site Map control in ASP.NET 3.5. | Go |
| Content Management System (CMS) developed in both desktop & web modes ... A custom Document Management application that would allow its staff and users to add, edit and review documents regardless of their physical location was developed for a Dutch insurance company. The documents stored in the system describe various workflow procedures, policies, specifications, offers, and they are grouped together in a tree-based hierarchy. | Go |
| New ASP.NET 3.5 Chart Controls for VS 2008 ... The ASP.NET Team have just released an amazing set of chart controls for Visual Studio 2008, with both Web and Windows versions. | Go |
| ParseChildren, PersistChildren and PersistenceMode.InnerProperty ... An excellent explanation of how to use the ParseChildren and PersistChildren attributes to create controls that can persist their child tags. Children can either be added to the control's control collection or to a property of your choice. For example that's how the items in a DropDownList work. | Go |
| The Controls Collection Cannot Be Modified... ... Have you run across this show-stopper before? If so, here's why it's happening, and here's an easy way to fix it. | Go |
| Sharing Master Pages amongst Applications by Embedding it in a Dll ... If you need to share Master Pages across applications and you don't want to create a ton of virtual directories, [here] is a way to do that. You can embed the Master Page as a Resource in your Dll and use VirtualPathProvider mechanism to call the Resource. | Go |
| Partial page updates with ASP.NET MVC and jQuery (and action filters) ... When building an ASP.NET MVC application, chances are that you are using master pages. After working on the application for a while, it's time to spice up some views with jQuery and partial updates. | Go |
| Model View Presenter ... In this article we will understand MVP, execute a sample project with MVP, implement the same using windows UI and then finally we will discuss about the differences between MVP and MVC. | Go |
| Taking a look at the various ways to implement Binding in Asp.Net MVC ... A short screen casts that takes a look at the various ways to implement Binding in Asp.Net MVC | Go |
| Model View Presenter ... In this article we will understand MVP, execute a sample project with MVP, implement the same using windows UI and then finally we will discuss about the differences between MVP and MVC. | Go |
| Useful Cache and Session Method Extensions for ASP.NET ... In the line of Method Extensions here is some Extensions for Cache and Session for ASP.NET | Go |
| New ASP.NET Charting Control ... From ScottGu's blog. Brand new, Free, ASP.NET 3.5 chart control. It looks very nice! | Go |
| Microsoft Web Platform Installer RC and Windows XP Support ... Mictosoft Web Platform Installer, a great tool that Microsoft provides is now in Release Candidate and supports Windows XP | Go |
| ASP.NET 3.5 MVC Application ... This post gives you the basic overview on ASP.NET Models, Views and Controllers. It explains how all parts in MVC Application work together and discuss how the architecture of an ASP.NET MVC application differs from an ASP.NET Web Forms application. | Go |
| Delicious tagged ASP.NET Links |
| New ASP.NET Charting Control: - ScottGu's Blog | Go |
| jQuery Intellisense in VS 2008 - ScottGu's Blog | Go |
| Tracking User Activity | Go |
| David Ebbo's blog : ProcessGeneratedCode: A hidden gem for Control Builder writers | Go |
| ASP.NET.4GuysFromRolla.com: Creating Charts with the Google Chart API | Go |
| ASP.NET Patterns every developer should know - developerFusion - the global developer community | Go |
| Combining JQuery Form Validation and Ajax Submission with ASP.NET | Go |
| jQuery Ajax uploader plugin (with progress bar!) " | Go |
| Scott Gu Blog Links |
| New ASP.NET Charting Control: ... Microsoft recently released a cool new ASP.NET server control - <asp:chart /> - that can be used for free with ASP.NET 3.5 to enable rich browser-based charting scenarios: Download the free Microsoft Chart Controls Download the VS 2008 Tool Support for the Chart Controls Download the Microsoft Chart Controls Samples Download the Microsoft Chart Controls Documentation Visit the Microsoft Chart Control Forum Once installed the <asp:chart/> control shows up under the "Data" tab on the Toolbox, and can be easily declared on any ASP.NET page as a standard server control: <asp:chart /> supports a rich assortment of chart options - including pie, area, range, point, circular, accumulation, data distribution, ajax interactive, doughnut, and more. You can statically declare chart data within the control declaration, or alternatively use data-binding to populate it dynamically. At runtime the server control generates an image (for example a .PNG file) that is referenced from the client HTML of the page using a <img/> element output by the <asp:chart/> control. The server control supports the ability to cache the chart image, as well as save it on disk for persistent scenarios. It does not require any other server software to be installed, and will work with any standard ASP.NET page. To get a sense of how to use the <asp:chart /> control I recommend downloading the Microsoft Chart Controls Sample Project . This includes over 200 ASP.NET sample pages that you can run locally. Just open the web project in VS 2008 and hit run to see them in action - you can then open the .aspx source of each to see how they are implemented. The below example (under Chart Types->Line Charts->3D Line and Curve Charts) demonstrates how to perform Line, Spline and StepLine charting: The below example (under Chart Types->Pie and Doughnut Charts) demonstrates a variety of pie and 3D doughnut options: The below example (under Chart Types->Advanced Financial Charts) demonstrates some graph charts: In addition to the above samples, you can download the Microsoft Chart Control Documentation or ask questions on the Chart Controls Forum to learn more. This should provide a useful (and free) addition to your standard ASP.NET toolkit of functionality, and enable you to easily add richer visualization and data workflow scenarios to your ASP.NET applications. Hope this helps, Scott | Go |
| 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 | Go |
| Update on Silverlight 2 - and a glimpse of Silverlight 3 ... We shipped Silverlight 2 last month. Over the last 4 weeks, the final release of Silverlight 2 has been downloaded and installed on more than 100 million consumer machines. It has also recently been published to corporate administrators via the Microsoft SMS and Microsoft Update programs to enable them to automatically deploy across enterprises. Over 1 in 4 computers on the Internet now have some version of Silverlight installed. Silverlight 2 was a major release, and delivered an impressive set of cross-browser, cross-platform functionality for Media and Rich Internet Application experiences. It has been great watching new sites launch using it. Media Experiences Silverlight 2 enables the highest quality video on the web, and delivers it with the lowest TCO of any media platform. One of the capabilities built-into Silverlight 2 is its support for "adaptive streaming" - which enables video to be delivered at multiple bitrates (for example: 400Kbits, 800Kbits, 1.5Mbits, 2Mbits) with Silverlight dynamically choosing the optimal bitrate to use depending on the network bandwidth and CPU capability of the client (it can also automatically switch bitrates seamlessly if conditions change later). Silverlight's adaptive streaming support is extensible. Move Networks (who helped pioneer the concept of adaptive streaming) have already integrated their adaptive streaming solution with Silverlight. Silverlight 2 and Move were used to stream the Democratic National Convention live on the web this summer. Last month we announced that Microsoft will be adding adaptive streaming support as a free feature of our IIS7 web-server. IIS Smooth Streaming will provide an integrated way to deliver HD quality adaptive video over the web. Visit Akamai's www.smoothhd.com site to see some awesome examples of Silverlight 2 and IIS Smooth Streaming in action (with adaptive streaming up to 2.5Mbits). The NBC Olympics site used Silverlight 2 to serve more than 3,500 hours of live and on-demand Olympic coverage to over 60 million unique visitors this summer. Visitors to the site watched an average of 27 minutes of video - which is stunningly high for online video. The site used the new Silverlight adaptive streaming capability to support 1.5Mbit bitrates - which helped deliver an awesome video experience: In addition to powering the Olympics experience in the US, Silverlight was also used in France (by FranceTV ), the Netherlands (by NOS ), Russia (by Sportbox.ru ) and Italy (by RAI ). In addition to video quality, a big reason behind these broadcasters decision to use Silverlight was the TCO and streaming cost difference Silverlight provided. In the August 2008 edition of Web Designer Magazine (a Dutch publication) a NOS representative reported that they were able to serve 100,000 concurrent users using Silverlight and 40 Windows Media Servers, whereas it would have required 270 servers if they had used Flash Media Servers. Over the last month we've seen several major new deployments of Silverlight for media scenarios. For example: CBS College Sports is now using Silverlight to stream NCAA events from its 170 partner colleges and university. Blockbuster is replacing Flash with Silverlight for its MovieLink application. And Netflix two weeks ago rolled out its new Instant Watch service using Silverlight. Rich Internet Applications (RIA) Experiences Silverlight 2 delivers a cross-browser, cross-platform subset of the .NET Framework, and enables developers to build Rich Internet Applications. Developers can use either VS 2008 or the free Visual Web Developer 2008 Express to open and edit Silverlight 2 projects, and get a powerful code-focused .NET development environment. Designers can use Expression Blend 2 SP1 to open and edit the same projects and use a creative tool to sculpt and create rich user experiences. I recently blogged about the nice dev | Go |
| Styling a Silverlight Twitter Application with Expression Blend 2 ... Silverlight 2 provides a rich platform for building cross-browser/cross-platform RIA applications. One of the things that makes Silverlight so powerful is the ease with which developers and designers can collaborate together on projects. Developers can use Visual Studio to open and edit Silverlight 2 projects and get a powerful code-focused .NET development environment, and designers can use Expression Blend 2 SP1 to open and edit the exact same project and use a creative tool to sculpt and create optimal user experience designs. The WPF UI framework shipped in Silverlight further enables a great designer/developer workflow by supporting concepts like layout management, controls, styles, templates, and resources - which help avoid scenarios where designers and developers end up tripping over each other when integrating functionality, behavior and expressive design. Silverlight 2 Twitter Sample Last month I posted an in-depth blog tutorial on how to build a Silverlight 2 Digg application which you can read here . This tutorial was aimed primarily at developers, and focused on introducing the fundamental programming concepts involved when building a Silverlight 2 application. Today Celso Gomes and Peter Blois posted a cool 10 minute video tutorial that shows off using Expression Blend to stylize a Silverlight 2 Twitter Messenger application. You can watch the video here . You can download the source code for the completed Silverlight Twitter application here . The video does a nice job demonstrating how designers can re-style a Silverlight application without having to mess with the code behind it. In the process it shows some of the power and capability that Expression Blend 2 provides to build really rich user experiences. Celso starts with a developer version of the application, and then customizes and sculpts the UI to have a fun twitter character theme: The Application Model The Silverlight Twitter client is hosted within an ASP.NET server application that exposes a web service that enables the Silverlight Twitter application to communicate to the Twitter service (since Twitter does not allow direct access from client applications). Communication between the Silverlight client and the ASP.NET web server is done using Windows Communication Foundation (WCF). The client application uses a Model-View-Presenter (MVP) pattern (also known as the Model-View-ViewModel pattern) which is commonly used in large WPF applications. Even though this is a fairly simple application they wanted to take advantage of the flexibility that MVP allows and allow room for future growth. Maintaining the separation between the visuals and the application logic also enables designers to make fairly complex visual changes without impacting the basic application flow. The video goes through some examples of the styling flexibility this architecture facilitates. The Styling Process In the video, Celso highlights how Resources can help designers quickly change colors. A common Brush Resource, for example, can be used to change the color of all the text elements in the application: Celso shows how easy is to create new User Controls from graphics using Expression Blend 2 SP1 (just select multiple elements in the designer, right-click, and choose the "Make Control" menu option): And also how to create new states inside this new User Control (using the Visual State Manager feature - which is also now supported with WPF), to animate the bird (fly, blink, etc...) Celso also shows how to create animations for each state, changing advanced properties like Key Spline curves, and Repeat Behavior: He also shows how to create custom buttons from drawings (which can come from XAML or any other design tool like Photoshop or Illustrator). All the states of a Button Control are available out of the box. Expression Blend also enables you to easily change complex controls like List Boxes. Designers have acce | Go |
| 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 6 New ASP.NET Dynamic Data Videos : Joe Stagner has just published 6 new videos on the www.asp.net site that cover how to use the cool new ASP.NET Dynamic Data functionality introduced with .NET 3.5 SP1. 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. Examining ASP.NET 2.0's Membership, Roles and Profile - Part 13 : Scott Mitchell has another post in his great series of ASP.NET security articles. This one covers how to create a login screen that allows admin users to log in as another user in the user database. For more on ASP.NET security, also check out Joe Stagner's recent ASP.NET Security Videos . 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. Working with ADO.NET Data Services with ASP.NET AJAX : Jim Wang has a nice blog post that demonstrates how to take advantage of the new ASP.NET AJAX features (client templating, ADO.NET data service support, etc) to build a data driven AJAX solution. 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 cove | Go |
| October 22nd Links: ASP.NET, Visual Studio, WPF and 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 Building a Great ASP.NET AJAX Application from Scratch : Brad Abrams has a nice end to end application tutorial that shows off building an ASP.NET AJAX application from scratch. It covers ASP.NET, LINQ, Server and Client-side AJAX, the ASP.NET AJAX Control Toolkit, jQuery and more. A great end to end read. A Guide to Learning the ASP.NET MVC Beta : Stephen Walther has a great set of links with some good videos and tutorials you can follow to learn more about the recent ASP.NET MVC beta release. ASP.NET MVC and the new IIS7 URL Rewriting Module : Scott Hanselman has a great post that shows off using the new IIS7 Rewriitng Module (which is free and very, very cool) to deliver great SEO (search engine optimization) for sites built with ASP.NET and specifically ASP.NET MVC. 7 of my Favorite jQuery plugins for use with ASP.NET : Dave Ward has a nice blog post that talks about 7 of his favorite jQuery plugins and how he uses them with ASP.NET. Using jQuery to display a modal ASP.NET UpdatePanel confirmation : Dave Ward has another nice blog post that talks about how to use jQuery with the ASP.NET AJAX UpdatePanel control. Using jQuery Load with the ASP.NET MVC Framework : Jason has a nice simple sample that demonstrates how to use jQuery to load an ASP.NET MVC view remotely and populate a page on the client. Visual Studio Essential Visual Studio Tips & Tricks that Every Developer Should Know : Stephen Walther has a fantastic article with 11 cool tips and tricks that you should make sure you know and use with Visual Studio. VS 2008 Snippet Designer : A cool utility that enables you to quickly create re-usable Visual Studio snippets. Very handy for automating common tasks. Silverlight and WPF XAML Power Toys Released for WPF and Silverlight : Karl Shifflett has released an awesome update to his XAML Power Toys download. This is a must-have download if you are doing WPF or Silverlight development, and provides a bunch of great wizards and tools that help automating application development. Very, very cool stuff. WPF Pixel Shader Effects Library on CodePlex : .NET 3.5 SP1 added Pixel Shader support to WPF - which enables you to add cool DirectX optimized visual effects to any WPF control or surface. This article from Jamie points to a nice new CodePlex project that is available that delivers a bunch of pre-built effects you can use. Silverlight 2 UI Templates : Tim Heuer writes about some cool new UI templates available for the recently released Silverlight 2. Viewing Design Time Data in VS 2008 WPF and Silverlight Designers : Karl Shifflett has another nice article that talks about some techniques you can use to see sample data in the VS 2008 WPF and Silverlight designers when building applications. Hope this helps, Scott | Go |
| ASP.NET MVC Beta Released ... Today we released a beta of the new ASP.NET MVC framework. Click here to download it. You can also visit www.asp.net/mvc to explore tutorials , quickstarts , and videos to learn more. The ASP.NET MVC Beta works with both .NET 3.5 and .NET 3.5 SP1, and supports both VS 2008 and Visual Web Developer 2008 Express SP1 (which is free - and now supports class libraries and web application project types). Today's ASP.NET MVC Beta release comes with an explicit "go-live" license that allows you to deploy it in production environments. The previous preview releases also allowed go-live deployments, but did so by not denying permission to deploy as opposed to explicitly granting it (which was a common source of confusion). Today's release is clearer about this in the license. The beta release is getting close to V1 feature complete, although there are still a few more features that will be added before the final "V1" release (including several VS tooling enhancements). The team decided to call this release a "beta", though, because the quality and testing of it is higher than the previous previews (a lot of bug fixes and performance tuning work went into it), and they feel that the core features that are in it are now "baked enough" that there won't be major changes from this release to the final product. This post contains a quick summary of some of the new features and changes in this build compared to the previous "Preview 5" release: New "Add View" Menu in Visual Studio New \Scripts directory and jQuery Support Built-in Model Binder Support for Complex Types Refactored Model Binder Infrastructure Strongly Typed UpdateModel and TryUpdateModel WhiteList Filtering Improved Unit Testing of UpdateModel and TryUpdateModel Scenarios Strongly Typed [AcceptVerbs] attribute Better Validation Error Messages HTML Helper Cleanup and Refactoring Silverlight / ASP.NET MVC Project Integration ASP.NET MVC Futures Assembly \Bin and GAC Assembly Deployment I am also planning to publish a few end to end tutorials in the weeks ahead that explain ASP.NET MVC concepts in more depth for folks who have not looked at it before, and who want a "from the beginning" set of tutorials on how to get started. New "Add View" Menu in Visual Studio With previous ASP.NET MVC preview releases you had to manually add views through the Project->Add New Item dialog in VS, and creating and wiring up everything required several manual steps (making sure the directory/file structure is right, going into the code-behind file to specify the strongly typed ViewData model type, etc). Today's beta makes the steps much easier. You can now just move your source editor cursor to be within a Controller action method in the source editor, and then right-click and select a new "Add View" context menu item (alternatively you can type the Ctrl-M Ctrl-V keyboard shortcut to invoke this without having to take your hands off the keyboard): This will bring up a new "Add View" dialog that allows you to specify the name of the view you want to create, its master page, and optionally its strongly typed ViewData "Model" type: Visual Studio will automatically pre-populate the view name based on the action method your cursor is within (you can then override this if you want). For example, if our cursor had been within an "Edit" action method when we selected "add view" it would have pre-populated the view name textbox with "Edit" instead of "Browse". The strongly typed ViewData "model" for a view can be selected from an editable ComboBox that lists all classes in (or referenced) from the MVC project: You can either select a type from the list, or manually type one in the ComboBox. You can also optionally pick an initial type from the list and then tweak it. For example, we could select the "Product" class from the list and then use the ComboBox editing support to wrap it as an IEnumerable<Product> - meaning a sequence of pr | Go |
| Silverlight 2 Released ... Today we shipped the final release of Silverlight 2. You can download Silverlight 2, as well the Visual Studio 2008 and Expression Blend 2 tool support to target it, here . Cross Platform / Cross Browser .NET Development Silverlight 2 is a cross-platform browser plugin that enables rich media experiences and .NET RIAs (Rich Internet Applications) within the browser. Silverlight 2 is small in size (4.6MB) and takes only 4-10 seconds to install on a machine that doesn't already have it. It does not require the .NET Framework to be installed on a computer to run - the Silverlight setup download includes everything necessary to play video or run applications. Developers can write Silverlight applications using any .NET language (including VB, C#, JavaScript, IronPython and IronRuby). Silverlight provides a rich set of features for development including: WPF UI Framework : Silverlight 2 includes a rich UI framework that makes building rich Web applications much easier. In includes a powerful graphics and animation engine, as well as rich support for higher-level UI capabilities like controls, layout management, data-binding, styles, and template skinning. The WPF UI Framework in Silverlight is a compatible subset of the WPF UI Framework features in the full .NET Framework, and enables developers to re-use skills, controls, code and content to build both rich cross browser web applications, as well as rich desktop Windows applications. Rich Controls : Silverlight 2 includes a rich set of built-in controls that developers and designers can use to quickly build applications. The Silverlight 2 release includes core form controls (TextBox, CheckBox, RadioButton, ComboBox, etc), built-in layout management panels (StackPanel, Grid, Panel, etc), common functionality controls (Slider, ScrollViewer, Calendar, DatePicker, etc), and data manipulation controls (DataGrid, ListBox, etc). All Silverlight controls support a rich control templating model, which enables developers and designers to collaborate together to build highly polished solutions. Rich Networking Support : Silverlight 2 includes rich networking support. It includes out of the box support for calling REST, WS*/SOAP, POX, RSS, and standard HTTP services. It supports cross domain network access (enabling Silverlight clients to directly access resources and data from resources on the web). It also includes built-in sockets networking support. Rich Base Class Library : Silverlight 2 includes a rich .NET base class library of functionality (collections, IO, generics, threading, globalization, XML, local storage, etc). It includes rich APIs that enable HTML DOM/JavaScript integration with .NET code. It includes LINQ and LINQ to XML library support (enabling easy transformation and querying of data), as well as local data caching and storage support. The .NET APIs in Silverlight are a compatible subset of the full .NET Framework. Rich Media Support : Silverlight 2 includes built-in video codecs for playing high definition video, as well as for streaming it over the web (including both live and on-demand support). Silverlight includes support for adaptively switching video bitrates on the fly based on network conditions (enabling users to avoid seeing the dreaded "buffering..." message), placing and metering ads within video streams, as well as enabling content protection. The final Silverlight 2 release delivers a tremendous amount of power and flexibility that enables you to really push the boundaries of what can be done in a browser, and enable great end user experiences. Silverlight Customers Over the last few months a number of very high profile sites have successfully launched using the beta releases of Silverlight 2. In August, NBC hosted the Olympics live on nbcolympics.com and served up 1.3 billion page views, 70 million video streams, and 600 million minutes of video content - makin | Go |
| 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 Best Practices for Creating ASP.NET websites with IIS 6.0 : Omar Al Zabir, author of the excellent Building a Web 2.0 Portal with ASP.NET 3.5 book , has a great article that details best practices to follow when setting up a site on IIS 6.0. Definitely worth reading and book-marking. 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 . Exploring Caching in ASP.NET : Abhijit Jana has a nice article that discusses caching options with ASP.NET. If you are interested in another nice (but not well known) caching technique, you might also want to check out my prior Tip/Trick post on "Donut Caching" using the ASP.NET 2.0 Output Cache Substitution feature . 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 Continuous Integration and Deployment using CruiseControl.NET, Subversion, MSBuild and Robocopy : Omar Al Zabir has another great article - this time on implementing continuous integration with ASP.NET. 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. Using jQuery to enhance ASP.NET AJAX progress indication : Dave Ward has a cool article that describes how to integrate jQuery functionality with the ASP.NET AJAX UpdatePanel control to enable better progress indication status. 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. 46 ASP.NET AJAX Control Toolkit Tutorials : Christian Wenz has published 46 super useful tutorials in both VB and C# that show of how to perform common scenarios with the ASP.NET AJAX Control Toolkit. Microsoft Web Platform Web Platform Installer: Make it easy to setup for web development : Scott Hanselman has a nice post that shows off the new "Microsoft Web Platform Installer" we are building that provides an easy way to quickly install every Microsoft web component out there - and quickly get a machine ready for web development. Hope this helps, Scott | Go |
| October 2nd Links: ASP.NET, ASP.NET MVC, ASP.NET Dynamic Data ... 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 Amazon EC2 Support for Windows and ASP.NET: Big news announced this week: Amazon will be offering Windows Server 2008 as an option in their EC2 service. This enables you to use ASP.NET, IIS7 and SQL Server in the cloud. Using ASP.NET WebForms, MVC and Dynamic Data in a Single Application : Scott Hanselman has a nice post that demonstrates how you can have a single ASP.NET application that uses ASP.NET WebForms, MVC, WebServices and Dynamic Data. You have the flexibility to mix and match them however you want, which allows you to always use the right tool depending on the specific job. Modifying Data with the ListView's EditItemTemplate : Matt Berseth has a great post that talks about how to use the ASP.NET 3.5 ListView control to enable in-place editing scenarios - with total html markup control. 4 New Grouping Grid Skins: Vista, Bold, Win2k3 and Soft : Matt Berseth has another nice post that demonstrates how to skin the ASP.NET ListView control to enable some sweet data grouping scenarios. Unlocking and Approving User Accounts : Scott Mitchell posts another in his great series of articles on ASP.NET security (click here for all the articles in the series). This article talks about how you can setup administration pages that allow admins to lock out and approve user accounts using the ASP.NET Membership system. Adding OpenID to you website in conjunction to ASP.NET Membership : Dan Hounshell has a nice article that discusses how to add OpenID authentication support to your web-site, and use it in conjunction to ASP.NET's built-in membership system. ASP.NET MVC MVC Membership with Preview 5 : Troy Goode posts an update of his popular MVC Membership template that works with ASP.NET MVC Preview 5. It provides a set of administration pages you can use for user/role management, as well as adds support for OpenID and Windows LiveID. MVC Flickr Xplorer : Mehfuz Hossain has a cool ASP.NET MVC sample application posted that enables a nice picture explorer for FlickR photos. ASP.NET Dynamic Data Simple 5 Table Northwind Example : Matt Berseth kicks off his ASP.NET Dynamic Data tutorial series with a nice post that shows how to build a simple 5 table application using ASP.NET Dynamic Data with .NET 3.5 SP1. Dynamic Data And Custom Metadata Providers : Matt continues the series and covers the MetadataType attribute, and how you can use it to annotate your entities with additional metadata. Dynamic Menu for your Dynamic Data: Matt continues and covers how to add a data-driven menu to the site. Customizing the Delete Confirmation Dialog : Matt continues and demonstrates how to build a nice UI experience when deleting records in a dynamic data application. Experimenting with YUI's DataTable and DataSource Controls : Matt experiments with how to use client-side AJAX components together with dynamic data. Hope this helps, Scott | Go |
| 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 w | Go |
| Silverlight 2 Release Candidate Now Available ... This evening we published the first public release candidate of Silverlight 2. There are still a small handful of bugs fixes that we plan to make before we finally ship. We are releasing today's build, though, so that developers can start to update their existing Silverlight Beta2 applications so that they'll work the day the final release ships, as well as to enable developers to report any last minute showstopper issues that we haven't found internally (please report any of these on the www.silverlight.net forums). Important: We are releasing only the Silverlight Developer Runtime edition (as well as the VS and Blend tools to support it) today, and are not releasing the regular end-user edition of Silverlight. This is because we want to give existing developers a short amount of time to update their applications to work with the final Silverlight 2 APIs before sites are allowed to go live with it. There are some breaking changes between Beta2 and this RC, and we want to make sure that existing sites can update to the final release quickly once the final release is out. As such, you can only use the RC for development right now - you can't go live with the new APIs until the final release is shipped (which will be soon though). You can download today's Silverlight Release Candidate and accompanying VS and Blend support for it here . Note that Expression Blend support for Silverlight 2 is now provided using Blend 2.0 SP1. You will need to install Blend 2.0 before applying the SP1 service pack that adds Silverlight 2 support. If you don't already have Blend 2.0 installed you can download a free trial of it here . Beta2->RC API Updates Today's release candidate includes a ton of bug fix and some significant performance optimization work. Today's release candidate also includes a number of final API tweaks designed to fix differences between Silverlight and the full .NET Framework. Most of these changes are relatively small (order of parameters, renames of methods/properties, movement of types across namespaces, etc) although there are a number of them. You can read this blog post and download this document to get a listing of the known API breaking changes made from the Beta2 release. We have updated the styles of the controls shipped with Silverlight, and have also modified some of the state groups and control template names they use. When upgrading from Beta2 you might find it useful to temporarily remove any custom style templates you've defined, and get your application functionality working using the RC first - and then after that works add back in the styles one style definition at a time to catch any rename/behavior change issues with them. If you find yourself stuck with an question/issue moving from Beta2 to the RC, please report it on the www.silverlight.net forums (Silverlight team members will be on there helping folks). If after a day or two you aren't getting an answer please send me email (scottgu@microsoft.com ) and I can help or connect you with someone who knows the answer. New Controls Today's release candidate includes a bunch of feature additions and tweaks across Silverlight 2, as well as in the VS and Blend tools targeting it. In general you'll find a number of nice improvements across the controls, networking, data caching, layout, rendering, media stack, and other components and sub-systems. Over the next few months we will be releasing a lot of new Silverlight 2 controls (more details on these soon). Today's release candidate includes three new core controls - ComboBox, ProgressBar, and PasswordBox - that we are adding directly to the core Silverlight runtime download (which is still only 4.6MB in size, and only takes a few seconds to install): At runtime these controls by default look like: The ComboBox in Silverlight 2 supports standard DropDownList semantics. In addition to statically defining items like above, you | Go |
| ASP.NET MVC Preview 5 and Form Posting Scenarios ... This past Thursday the ASP.NET MVC feature team published a new "Preview 5" release of the ASP.NET MVC framework. You can download the new release here . This "Preview 5" release works with both .NET 3.5 and the recently released .NET 3.5 SP1. It can also now be used with both Visual Studio 2008 as well as (the free) Visual Web Developer 2008 Express SP1 edition (which now supports both class library and web application projects). Preview 5 includes a bunch of new features and refinements (these build on the additions in "Preview 4" ). You can read detailed "Preview 5" release notes that cover changes/additions here . In this blog post I'm going to cover one of the biggest areas of focus with this release: form posting scenarios. You can download a completed version of the application I'll build below here . Basic Form Post with a Web MVC Pattern Let's look at a simple form post scenario - adding a new product to a products database: The page above is returned when a user navigates to the "/Products/Create" URL in our application. The HTML form markup for this page looks like below: The markup above is standard HTML. We have two <input type="text"/> textboxes within a <form> element. We then have an HTML submit button at the bottom of the form. When pressed it will cause the form it is nested within to post the form inputs to the server. The form will post the contents to the URL indicated by its "action" attribute - in this case "/Products/Save". Using the previous "Preview 4" release of ASP.NET we might have implemented the above scenario using a ProductsController class like below that implements two action methods - "Create" and "Save": The "Create" action method above is responsible for returning an html view that displays our initial empty form. The "Save" action method then handles the scenario when the form is posted back to the server. The ASP.NET MVC framework automatically maps the "ProductName" and "UnitPrice" form post values to the method parameters on the Save method with the same names. The Save action then uses LINQ to SQL to create a new Product object, assigns its ProductName and UnitPrice values with the values posted by the end-user, and then attempts to save the new product in the database. If the product is successfully saved, the user is redirected to a "/ProductsAdded" URL that will display a success message. If there is an error we redisplay our "Create" html view again so that the user can fix the issue and retry. We could then implement a "Create" HTML view template like below that would work with the above ProductsController to generate the appropriate HTML. Note below that we are using the Html.TextBox helper methods to generate the <input type="text"/> elements for us (and automatically populate their value from the appropriate property in our Product model object that we passed to the view): Form Post Improvements with Preview 5 The above code works with the previous "Preview 4" release, and continues to work fine with "Preview 5". The "Preview 5" release, though, adds several additional features that will allow us to make this scenario even better. These new features include: The ability to publish a single action URL and dispatch it differently depending on the HTTP Verb Model Binders that allow rich parameter objects to be constructed from form input values and passed to action methods Helper methods that enable incoming form input values to be mapped to existing model object instances within action methods Improved support for handling input and validation errors (for example: automatically highlighting bad fields and preserving end-user entered form values when the form is redisplayed to the user) I'll use the remainder of this blog post to drill into each of these scenarios. [AcceptVerbs] and [ActionName] attributes In our sample above we implemented ou | Go |
| Quick Update ... I've received a number of (very nice) emails recently asking if I was ok - since my blog has been silent the last few weeks (and much of the summer). Just to address people's concerns - I'm alive and well. :-) I've just been on vacation the last 6 weeks, and have unfortunately not had free time to post (I've been changing a lot of diapers). I am still on vacation another week before I officially return to work. I did get a chance to write up a quick post this weekend that covers some of the new ASP.NET MVC Preview 5 features, though, that will hopefully provide some interim reading until I can resume a more regular posting schedule over the next month when I get back into the office. Thanks, Scott P.S. Somewhat to my embarrassment I started a Part1/Part2 post on "Preview 4" right before I left for vacation, and didn't have time to finish part 2 before "Preview 5" came out. I am going to post this lost segment (which covered AJAX) later this month and write it against the latest preview build. P.P.S. People often ask me whether I write my own blog. Yep - I actually really do write every single post. Hopefully my absence the last 6 weeks provides some evidence to support this. :-) | Go |
| ASP.net.com Community Links |
| Retain position of a DragPanel Extender after postback using ASP.NET AJAX ... The DragPanel extender makes it extremely simple to add a ‘drag’ to your controls. However there is a functionality missing in the DragPanel extender. The DragPanel extender does not have the built-in capability to retain the position of controls that have been dragged, after a page postback. In this article, we will see how to retain the position of the DragPanel extender, after a postback. | Go |
| Storing and Retrieving Connection Strings in ASP.NET 2.0/3.5 ... This article demonstrates how to store database connection strings in Web.config in ASP.NET 2.0/3.5 and retrieve it for creating connection objects. | Go |
| Loading Images Asynchronously Inside an ASP.NET GridView ... Retrieving and displaying images in a GridView is a time consuming task. If done synchronously, this task can at times test the user’s patience. One way to provide a good user experience is to load the images asynchronously. So when the GridView loads, we initially display a default image for the user to view, while the actual images are being loaded from the database. In this article, we will see how to do so. | Go |
| XML DataSource control in ASP.NET 3.5 ... In this article I am going to discuss how to use XmlDataSource control in ASP.NET 3.5 | Go |
| Tracking User Activity ... Scott Mitchell talks about tracking user activity in web applications. | Go |
| ASP .net Template Server Control ... The article shows a great use of Template server controls. In the example you will see how you can create a template server control and have access to all the other asp .net controls enclosed within. Here in the example we are trying to retrieve the values of the controls and restore them at later point. With .net if we design our base controls in right way it can save us thousands of lines of code. | Go |
| Ajax rounded corners control ... There is a very good control in AJAX to make rounded type shape. We can create rounded shape in many design by using Corners property of this control. | Go |
| Authorization in ASP.Net MVC using XML Configuration. ... Doing authorization in a clean way is always tricky, You want a delicate balance between an extreme abstraction and something like embedding roles in-side your compiled code, I have always preferred simple abstraction either using roles and their corresponding mappings in the database or using simple xml file to store action to role mappings. | Go |
| Using HoverMenuExtender with ASP.NET ListView to Update, Delete and Insert Records ... In this article, we will explore how to associate a HoverMenuExtender with a ListView control to update and delete records. The Listview control in this sample will also contain the functionality to add new records. | Go |
| DropDownList asp.net Control problems and challanges faced using appenddatabound items and autopostbacks ... This tutorial will help you in appending data items to a dropdownlist control which already have some listitems from the markup.Sometimes in this there is a problem of duplicate items being appended every time the page refreshes.So here we will see how to workaround this situation. | Go |
| CodeProject.com ASP Links |
| DotNetSlackers.com Links |
| Upload Large Files ... ASP.NET doesn't allow you to upload files bigger than 4MB to the server.... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| Give Us Your Feedback On DXperience 2008 Volume 3 Release Candidate ... Meet Stan, Serge and Nick. These guys are some of our hard working support engineers. And theyre looking for your feedback. Please give us your feedback on the upcoming DXperience 2008 Volume 3 release. The release candidate (RC) is available now to DXperience customers. To download the RC, just go to your Client Center account. Click on the DXperience product. Then click the Betas tab and start downloading. This release candidate expires in 6 days, on December 1st. So you only have a few more... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| New ASP.NET Charting Control: <asp:chart runat=""server""/> ... Microsoft recently released a cool new ASP.NET server control - <asp:chart /> - that can be used for free with ASP.NET 3.5 to enable rich browser-based charting scenarios: Download the free Microsoft Chart Controls Download the VS 2008 Tool Support for the Chart Controls Download the Microsoft Chart Controls Samples Download the Microsoft Chart Controls Documentation Visit the Microsoft Chart Control Forum Once installed the <asp:chart/> control... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| Model View Presenter ... Model View Presenter... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| Section 508 Compliant Renamed Accessibility Compliant ... The Section508Compliant property was added to all of our ASP.NET controls to support accessibility. Since this announcement, we thought about the Section508Compatibility property name. While Section508Compatibility certainly describes the feature the term, Section 508, however is used only in the US. And because we are an international company and have respect for all customers, we decided to rename this property. [Well, since Section 508 is not used by the rest of the world, also has something... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| Create a Guestbook by using XML serialization ... This article shows an easy way to create a guestbook using ASP.NET and XML serialization.... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| ASP.NET using GridView control as lookup ... ASP.NET using GridView control as lookup... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| Sing it brother Frans! ... http://weblogs.asp.net/fbouma/archive/2008/11/21/baby-sitter-framework-2-0-change-tracking-in-the-ef-v2-it-s-still-your-problem.aspx
So, I'm tooling around the web this morning and I came upon Frans Brouma's post about change tracking in EF. Let me say that I don't like EF so far, but that's a different discussion. I like and agree with Frans' point that it's one thing to be technically correct and to really miss the mark regarding what the customer needs.... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| Combining JQuery Form Validation and Ajax Submission with ASP.NET ... As I mentioned before, Im really excited that were shipping jQuery with ASP.NET MVC and with Visual Studio moving forward. Just recently, we issued a patch that enables jQuery Intellisense to work in Visual Studio 2008. But if youre new to jQuery, you might sit down at your desk ready to take on the web with your knew found JavaScript light saber, only to stare blankly at an empty screen asking yourself, Is this it? See, as exciting and cool as jQuery is, its really the vast array of plugins that... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| A Better Multi-Page Solution ... I've posted on multi-page Silverlight applications, and in fact have two videos (here and here) that show an approach that works quite well and that I was happy to steal at the time.
I recently received email from Lucas Stark (Senior Web Developer at Delta College) who suggested (quite correctly) that the pages should not have to find the PageSwitcher each time they want to navigate to another page, but rather they ought to be able to call a static method.
I've tinkered with the code he... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| Virtual TechDays November 2008 ... Virtual TechDays is our online technology forum for delivering sessions around ASP.NET, Silverlight and other technologies. The previous 2 virtual tech days have been hugely successful owing to the ease of delivery and attending it.
There are sessions around ASP.NET 3.5 SP1, Silverlight Toolkit, ASP.NET for Mobile etc., For a detailed agenda and registration, please visit http://www.virtualtechdays.com/
Cheers!!!... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| New Version of Error Logging Modules and Handlers (ELMAH) Available ... ELMAH is a free, open-source library created by Atif Aziz for logging errors that occur in an ASP.NET application. I've written about ELMAH many times before ; its one of the first things I setup when creating a new ASP.NET application. A new version - ELMAH 1.0 BETA 3 - was recently released.
With just a few minutes of setup and configuration you can have ELMAH automatically log unhandled exceptions to a number of different data stores - SQL Server, Oracle, a Microsoft Access database, an XML file, to an e-mail address, and so on. You can also write code to proactively record an error via the ELMAH library. Granted, ASP.NET provides some built-in support for logging errors via its health monitoring system , butELMAH is a simpler version of the health monitoring system that focuses specifically on error logging and is easier to configure. It also works in ASP.NET 1.x applications, whereas health monitoring is only available in ASP.NET 2.0 and up. What's more, ELMAH provides a built-in web page and RSS support for viewing error information.
So, what's new in ELMAH 1.0 BETA 3? The project page and issue tracker has the full set of details, but in a nutshell here are the enhancements that most interest me:
Three new error logging sources: Oracle, Microsoft Access, and VistaDB.
Log errors in AJAX applications.
Addition of an ErrorLogDataSourceAdapter, which you can use with the ObjectDataSource to declaratively work with the error log details from an ASP.NET page.
It is imperative that every web application in production log errors and report those errors to the development team. ELMAH offers this important functionality and can be setup, configured, and customized within a few minutes. Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| A Tale of Two Page Hits ... I keep falling into this trap. If you see the phenomenon of a page being hit twice on a single request, read the following:
Page Events Raised Twice
Conversion to Web Application Project Resets AutoEventWireup
In the same vein: Session_Start or Session_OnStart?.... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| One thing you didnt know about ASP.NET unless youre David Ebbo ... David has an excellent post about a pretty cool ASP.NET feature that you almost certainly dont know about. I had no idea for sure. Check it out. http://blogs.msdn.com/davidebb/archive/2008/11/19/a-hidden-gem-for-control-builder-writers.aspx... Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here . | Go |
| ASP.NET.com Links |
| Isolation Syntax for VB.NET - Your comments please ... I'm working on adding a VB.NET Friendly syntax for Typemock Isolator. If you're into VB, I'd love your input on the usability of this API and how to make it better. We'll start going through several basic scenarios that you can do using Typemock Isolator, and show them in VB proposed syntax: Faking instances of classes or interfaces Setting Stub return values or errors on methods Verifying the methods were called Swapping calls between two types Swapping future instances Faking Non Public Members Faking instances of classes or interfaces the method Fake() is part of a Module called "Test" so it can be used from the tests easily. You could also write Test.Fake(..) if you wanted. Setting Stub return values or errors on methods here are three examples of returning a fake result from a method or a bunch of methods (below). ThisCall(s) is located on the Module Test so you can also write Using Test.ThisCall.WillThrow(...) if you wanted to. Verifying that methods were called This would go at the end of an interaction test Here's an example of a full Arrange-Act-Assert in a test using VB and fakes: One possible thing I am considering is adding Arrange-Act-Assert "Regions" to the test by taking advantage of the "Using" feature: Question #1: What do think about the custom Arrange-act-assert regions? (they are option to use anyway) Swapping calls between two types This is the "duck typing" feature we introduced in Isolator: allowing you to make calls on one object be invoked on another, without them sharing the same interface, as long as the method names match. Swapping future instances Isolator supports faking the next creation of an object type, and replace that with the fake we create: Faking Non Public Members | Go |
| Visual Debian Installation Walkthrough using Virtual PC ... I had to work on some code inside of a “real” *nix system recently so I though I would give everyone a visual walkthrough of setting up the operating system. I need to pave a new image so I figured I would just share with the rest of the class setting up a *nix system from scratch using Virtual PC. You can accomplish the same with VMWare, I just happen to be using Virtual PC for this. For the OS I chose Debian . Actually I have several unix images for this type of work (Linux, NetBSD, etc.) but I’ve always liked Debian. It’s a slick text based install and works quite well, right down to the part of being able to select only what I need. I found the other Unixes to be cumbersome getting setup sometimes and not very visually appealing (installing NetBSD is like watching Justice Gray do his hair). So here’s the visual walkthrough of creating your own Debian install using Virtual PC. This install was done with Debian 4.0R5. Pre-Install You’ll need a couple of things to get started. First your Virtual PC (or VMWare if you choose) to run the guest operating system. You’ll also need an ISO image of Debian. I used the 180mb netinst ISO image file to start. It’s larger than the 40mb version but the 40mb version doesn’t even include the base system so I saved the download by getting the larger image. You can get the image from this page here . Choose the i386 ISO from the first list of options on the page. Once you’ve got the ISO ready you can setup your Virtual PC image and start. Here we go. The Walkthrough From Virtual PC, select the “New Virtual Machine Wizard” from the File Menu: Click Next Select “Create a virtual machine” from the options and click Next: Give the virtual machine a name and optionally choose a location. I keep all my VMs on a portable USB drive: Leave the operating system as “Other” and click Next: You can adjust the ram if desired. I’m doing console development so 128mb of RAM is fine. If you want to install X-Windows or something then you might want to bump this up. It can be changed later so you can leave it for now and click Next: Change the option to create a new virtual hard disk for you and click Next: By default the new virtual hard disk is created where your virtual machine is created. This is fine and you can leave the default then click Next: The confirmation screen will show you the options. Click Finish to create the new virtual machine. One more setting that you may need to change. Select the network adapter for the virtual machine to bridge to your host adapter. This allows Debian to obtain and IP and access the internet to download modules. Your Virtual PC Console will show you the new virtual machine ready to start. Select it and click Start: The new VM will boot but you need to capture the ISO image you downloaded earlier. Select CD from the menu and select Capture ISO Image: Now browse to where your netimage ISO is located and select it then click Open: From the Action menu in Virtual PC select Ctrl+Alt+Delete: Debian will now boot. Press enter to continue: A few hundred lines of gobbly-gook will flash by until you arrive at this screen. Pick your language and press enter: Choose your country next and press enter: Next choose a keyboard layout to use: After a few minutes of loading screens you’ll be asked to provide a hostname for the system. Enter one and click continue: By default the next screen will probably grab your ISP domain name but you can change it to whatever you want as this is going to be a local machine for testing. Enter a name and click continue: More hardware detection and the disk partitioning starts. As this is a VM you can just select the first option and let Debian guide you through using the entire disk. Select that option and press enter: Debian will find the 16gb hard drive the VM is showing (but it’s not really taking up 16gb on disk, well, not yet anyways). Select it and press enter: The next option is how you configure the partitions. For *most* *n | Go |
| Getting Started with the ASP.NET 3.5 Chart Control ... I think it’s safe to say that charting is a key part of many applications run on company Intranets. People like to see data visually as opposed to viewing it in rows and columns sometimes (especially higher level managers). While there are many 3rd party solutions available that provide charting solutions, you now have access to a very powerful solution from Microsoft that won’t set you back any $$ at all. Translated…it’s free! Sure, some of you may think that “free” products aren’t good but that’s not the case here. The new Chart control can generate visually stunning 2D and 3D charts without a lot of work on your part. In fact, there are over 25 different chart types that you can select for use in your ASP.NET or Windows Forms applications.
To get started using the Chart control you’ll need to download and install the following:
Microsoft Chart Controls (for ASP.NET and Windows Forms)
Visual Studio 2008 Tool Support for the Chart Controls
Once you’ve installed the chart controls you’ll see a System.Web.DataVisualization.dll assembly in the Global Assembly Cache. Within the assembly’s System.Web.UI.DataVisualization.Charting namespace you’ll find the new ASP.NET Chart control. Here’s a step by step look at getting started with the Chart control and binding it to data in a database using the good old SqlDataSource control.
1. Drag the Chart control from the VS 2008 Toolbox onto the design surface. You’ll see the following in the designer. Change the control’s Height and Width properties to 400 and 600 respectively in the Property window.
2. Click the Chart control’s smart tag and and bind it to a data source. I’ll use a basic SqlDataSource for this example and display the number of customers in each country from the Northwind database:
3. Right-click on the Chart and select Properties from the menu. Locate the ChartAreas property and click the ellipse (…) button.
4. A single chart area named ChartArea1 should show in the ChartArea Collection Editor window. Expand Area3DStyle and set (Enable3D) to True . This causes a 3D version of the chart to be generated which is cool if you’re trying to impress friends, family or your boss! You can change the perspective, rotation, plus more by tweaking properties.
5. If you want to change the background locate the Appearance section (still in the ChartArea Collection Editor) and choose a value for the BackColor and BackGradientStyle (if you want a gradient) properties:
6. Locate the Axes property and open the collection editor by clicking the ellipse (…) button. Within the X axis locate the Title property and change it to Countries . Within the Y(Value) axis locate the Title property and change it to Number of Customers .
7. Close the property editor windows and locate the Chart control’s Series property. Click the ellipse (…) button to open the property editor.
8. For the Series1 member locate the Data Source section and change the XValueMember to Country and YValueMembers to Column1 (or the name of the field returned from the query if you don’t use the one shown above in the SqlDataSource wizard). This tells the Chart control which fields to bind to based on what it gets back from the SqlDataSource.
9. Save the page and run it to see the chart in action:
10. Notice that not all of the countries are shown on the X axis. If you’d like to see all of them go back to the ChartAreas property, select Axes and locate the X axis , LabelStyle section. Change the Angel property to –90 and the Interval to 1 . Doing that will cause the following output to be generated:
Here’s what the ASPX code looks like at this point: < asp : Chart ID ="Chart1" runat ="server" Width ="600" Height ="400" DataSourceID ="SqlDataSource1">
< series >
< asp : Series Name ="Series1" XValueMember ="Country" YValueMembers ="Column1"
ChartType ="Column">
</ asp : Series >
</ series >
< chartareas >
< | Go |
| Silverlight resources for designers ... When I am training Silverlight I am often asked by designers how to find resources on Silverlight/XAML/Expression, so here is a post for them: First you can find lots of Expression Studio videos training in the new Microsoft videos portal: www.microsoft.com/video/en/us/categories/products/expression Lynda.com provides videos training on Expression Blend and Expression Design: Expression Blend Beta Preview (3 hrs) Getting Started with Expression Blend (3 hrs) Getting Started with Expression Design (6 hrs) Expression Design tutorials on the Microsoft Expression Team blog: http://blogs.msdn.com/expression/pages/samples-and-tutorials-gallery-expression-design.aspx Here are some XAML exporters to help you do Silverlight with your assets from Adobe tools: Illustrator AI to XAMLExport Photoshop Psd2Xaml Infragistics Fireworks to XAML Exporter The fantastic NibblesTutorials website (Expression Blend ): www.nibblestutorials.net This blog post collect free Silverlight controls and tools available on the net: www.webresourcesdepot.com/free-silverlight-controls-and-tools-for-brighter-websites/ And finally this interesting blog: www.designwithsilverlight.com Also as a designer you NEED to know about the Expression Professional Subscription , for a very good price ($999 USD) you get: Expression Studio 2 Visual Studio 2008 Standard Windows Vista Business Windows XP SP2 Office Standard Office Visio Professional Pre-configured virtualized server environments (VPC) Virtual PC (to use the VPC) Parallels Desktop for Mac (a 3rd party application to run Windows OS on Apple hardware concurrent with OSX) So typically if you are a MAC designer with no Microsoft platform tools you get everything you need to get started and create awesome user experience applications with Silverlight! Technorati Tags: Silverlight ,Silverlight training ,Expression ,designers ,xaml | Go |
| Hierarchical Treeview with ASP.NET MVC & jQuery ... First of all, an apology for being so quiet over the past few weeks. I've been putting my blogging aside for a while to chase some pet projects I'm working on. More on that later. I did, however, run into a particular situation that I thought would be of interest to anyone adopting ASP.NET MVC and looking for some goodies from jQuery. Many of you have no doubt started testing the waters with jQuery since it was announced that Microsoft will be shipping the next version of .NET with it included. If you haven't used jQuery yet, prepare to fall in love! In this post, I'm going to cover a simple way to build a deep, hierarchical and feature-rich tree structure with only one line of jQuery script. jQuery has a huge library of plugins covering all sorts of functionality. For this, we'll be using a neat plugin from for treeviews. Here's what you need: jQuery jQuery Treeview Plugin This structure will consist of a category/sub-category relationship that is able to support n-levels of sub-categories with no changes. To demonstrate, let's look at the SQL table that supports the structure. Notice the rows with ParentCategoryID set to NULL are the parent categories. Each row with a ParentCategoryID is a sub-category and relates to it's parent category. The numbers show the level in outline view. The jQuery Treeview plug-in requires the resulting HTML to be in a particular unordered list (<ul>) element to parse the tree correctly. Since we don't know how many levels to expect, we are going to call the MVC user control that renders each node recursively. This control accepts a single Category item. We render the name of that category and then check if it has any categories associated with it. If it does, we recursively render the control again. In the controller, we are simply passing in the categories where the ParentCategoryID == null. On the host view (Index.aspx), we create the root unordered list with an ID of "treeview" and pass in an array of the Parent categories (categories where the ParentCategoryID == null) from the controller. Here's a look at the output WITHOUT the jQuery magic. Now all we have to do is add the libraries we're going to use and hook up the Treeview plugin. Note: I always use the jQuery script from the Google API's. By referencing it from Google's server, you get to ride along their CDN, compression, etc. capabilities. As an added bonus, if your user has already visited a site that referenced the same library, the jQuery library would be cached on their browser so they don't take the hit of having to download it again. Sweet! In our jQuery script, we just get the ul's element ID and call the plugin's treeview() method with no options. When we refresh the page, we see jQuery has done its magic and now we have collapsable, rich tree view. There's a ton more options in the Treeview plugin that you can check out for yourself, including async loading with ajax, and tons of customizations. ASP.NET MVC and jQuery - a match made in heaven! Hope this helps! | Go |
| Tip #28 Did you know… That “Go to definition” is supported for CSS Class? ... If you have a style defined as Class = ”fooRed” as shown below and want to quickly know what does fooRed style contain? < div class ="fooRed"> In RED </ div > Just place your cursor on fooRed and hit the F12 button. This will highlight the CSS class for you even if the class lives in the Current Page or in an External style sheet . F12 is the short cut you can use instead of, Right Clicking fooRed and selecting “Go to Definition” action in the context menu as shown...(read more ) | Go |
| DDD7 Grok Talk - Open Source and Microsoft ... This weekend I attended DDD7 , a free community conference held at the Microsoft Reading Campus. I presented a short Grok talk during the lunch hour on Open Source and Microsoft. Since the event didn't seem to have a internet connectivity, I used Dom Green's laptop to allow me to prepare for it. After downloading Firefox on the machine, something was blocking it access to the web so I had to stick with IE8 * shudder *. To make sure all the sites were big and clear on the screens, I made sure I had...(read more ) | Go |
| My durable WCF RESTful calculator ... A durable service in WCF is by a definition a service that can persist all its internal state across calls in some durable storage. For every operation, the service state is retrieved from the storage, the operation is executed and finally the state is persisted again in the storage. Therefore, there is not need to keep the service instance idle in memory while waiting for client calls. It is equivalent to a long run session, which make this feature something ideal for long-running processes like workflows (In fact, workflow services are mount on top of this feature),
In order to create a durable service, WCF provides a "DurableService" attribute (It's a service behavior) that can be applied to a regular service definition. The service itself has to be either serializable or have members decorated with DataContract or DataMember attributes to be serialized and stored in the persistent storage.
The service activation, as in workflow services, is managed by the WCF context correlation mechanism. Once a service instance has been created, the client application has to propagate some context information(which includes the service instance id) in order to route all the new messages to the right service instance. Jesus has already discussed how this mechanism works more in detail in this post (Although the post is bit old and some names have changed since then, it is worth reading).
For purposes of this post, I decided to create a simple calculator example that exposes different operations through the classic http verbs,
[ServiceContract (Namespace = "http://Microsoft.WorkflowServices.Samples" )]
public interface ICalculator
{
[OperationContract ()]
[WebInvoke (Method = "POST" )]
int PowerOn();
[OperationContract ()]
[WebInvoke (Method = "PUT" , UriTemplate = "add" )]
int Add(int value);
[OperationContract ()]
[WebInvoke (Method = "PUT" , UriTemplate = "subtract" )]
int Subtract(int value);
[OperationContract ()]
[WebInvoke (Method = "PUT" , UriTemplate = "multiply" )]
int Multiply(int value);
[OperationContract ()]
[WebInvoke (Method = "PUT" , UriTemplate = "divide" )]
int Divide(int value);
[OperationContract ()]
[WebInvoke (Method = "DELETE" )]
void PowerOff();
}
The implementation of this service is also quite straightforward.
[Serializable ]
[DurableService ]
public class DurableCalculator : ICalculator
{
int _currentValue = 0;
[DurableOperation (CanCreateInstance=true )]
public int PowerOn()
{
return _currentValue;
}
[DurableOperation ]
public int Add(int value)
{
return (_currentValue += value);
}
[DurableOperation ]
public int Subtract(int value)
{
return (_currentValue -= value);
}
[DurableOperation ]
public int Multiply(int value)
{
return (_currentValue *= value);
}
[DurableOperation ]
public int Divide(int value)
{
return (_currentValue /= value);
}
[DurableOperation (CompletesInstance=true )]
public void PowerOff()
{
}
}
As you can see, I decorated the service implementation with the "DurableService" and "DurableOperation" attributes to make this simple service a durable one.
WCF only comes with built-in support for transferring the context information between the client and service with Http Cookies or Soap Headers. While cookies would be the right mechanism for http REST services, unfortunately they do not work as expected. The path that WCF uses for creating the cookies is relative, so the context manager throws the following exception on the client side,
Unhandled Exception: System.Net.CookieException: An error occurred when parsing the Cookie header for Uri 'http://localhost:8080/DurableCalculator'. ---> System.Net.CookieException: The 'Path'='/DurableCalculator/PowerOn' part of the cookie is invalid.
As workaround, we can use for this scenario the custom context binding I created some weeks ago to exc | Go |
| A Typemock Isolator for sharepoint , yes please! ... A great chance to test sharepooint and maybe even win a free isolator license :D
Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here .
The first 50 bloggers who blog this text in their blog and tell us about it, will get a Full Isolator license, Free . for rules and info click here . | Go |
| Looking at synchronization and one scary tool ... It is funny how things work out, a disaster can lead to opportunities. Last month my main pc at home somehow got a corrupt hard drive and at first I thought I had lost all my private data (family pictures, documents etc), the drive wasn’t backed up as it was a mirrored drive, which I had thought would be an alright disaster recovery mechanism. It happened while I was upgrading to Server 2008. I broke the mirror and disconnected them. So the drives themselves weren’t connected at the time of upgrade, it was when I reconnected them after the upgrade was successful, the OS just couldn’t see them, maybe a corrupt partition table. I even rolled back to Server 2003, but nothing. The most important thing was that I had to recover that data somehow. This lead me to a piece of software called Active File Recovery which is just so simple to use. To cut a long story short I managed to recover all my missing data. But one thing that really made me think was the fact that this software could see my data and all previous owners data (it was a 2nd hand drive bought from a computer fair). I have learnt several things from this experience, these being:- I need to use a more reliable medium. Using new hard drives instead of 2nd hand ones may have prevented this issue, but at the time (2002) I made the purchase there wasn’t a lot of data and it was the only viable option. I need a disaster recovery plan. Yes even for your home pc. I chose not to use a backup tool for my data for the simple fact that as there was around 13000 files, it would have took too long to run a back up on a machine which wasn’t permanently powered up. Be aware of old data. If upgrading an old hard drive, keep in mind that the data may still be recoverable. Dispose with care. Now I have my data back I needed to find a mechanism which would protect my data with the least amount of administration work. That is I don’t want to have to remember to run a back up every time I add a file to my important documents drive. This is what has lead me to the Synchronization Framework. Using an expanded on version of the file synchronization example I now have a mechanism which will synchronize my important docs with my NAS, running in the background as a service. I can sleep better at night now, but what if we have a flood or worse? All my data is still in the same location. My next personal project is to also get it to synchronize with the cloud; hello Live Mesh. | Go |