| DotNetKicks.com Links |
| ASP.NET MVC - Legacy Url Routing ... When converting web form applications to MVC, it requires a new Url structure. Learn how to handle legacy Url's within an MVC application by appropriately redirecting them to the correct MVC Url. | Go |
| List of usefull ASp.NET stuff ... Interesting links for Web Developers | Go |
| 47 ASP.NET MVC Resources to Rock Your Development ... Get the grand tour of today's best ASP.NET MVC resources | Go |
| 47 ASP.NET MVC Resources ... Craig Shoemaker highlights some of the best ASP.NET MVC resources available. | Go |
| Cross-post to LiveJournal Extension for BlogEngine.NET ... An extension to automatically cross-post new entries frorm BlogEngine.NET to LiveJournal. Version for MetaWeblog API coming soon (if there's an interest) | Go |
| SEO Page Manager For ASP.Net ... manage all your meta tags and sitemap urls in one convenient place | Go |
| Serving your ASP.NET .aspx pages with .html ... Need to serve your pages with an HTML extension instead of an ASPX extension? Start here! | Go |
| Auto login by URL signature ASP.NET module ... Do you like to go to a login page when you recieve an link from website to the private area page? What about a small signature added to the link which automatically logs user in? The module described in the article addes a signature to a URL, verifies it and logs user in. | Go |
| reCaptcha - Part 2 ... The second part of an article about reCaptcha. In this second part is showed how to create a ASP.NET validator using reCaptcha. | Go |
| Microsoft wants feedback: Where should the ASP.NET team release stuff? ... "So, dear customer I have a question for you (as apparently I've lost all perspective)...as I've written before I'm working on the releases for the ASP.NET team and one of the challenges I've been facing is *where* we should release stuff." | Go |
| Enabling Password Reset functionality when using ActiveDirectoryMember ... If you want to use ActiveDirectoryMembershipProvider on your website to manage users specially the password reset functionality, you will also need to create few attributes in the active directory schema for the USER object. | Go |
| Precompiling ASP.NET 2.0 websites ... ASP.NET 2.0 provides the ability to precompile websites into binaries before deploying them to the server. This has been a desired feature in the past and in this article we will see how simple it is to do so using ASP.NET 2.0. | Go |
| PayPal IPN VB.NET class ... this is the vb.net version of the paypal ipn class that I submitted here before. they just had a C# class, but now it looks like they have a vb.net class as well. | Go |
| Cross Page Posting In ASP.NET 2.0 ... Cross-page posting is desired in a scenario where data is collected on one Web page and processed on another Web page. ASP.NET 2.0 introduces a new property in the Page class called 'PreviousPage' which gets the page that posted to the current page . In this article, we will see how to use Cross Page Posting in ASP.NET 2.0. | Go |
| Delicious tagged ASP.NET Links |
| ASP.NET AJAX Web | Go |
| Dimebrain: Five recommendations for starting a startup with ASP.NET | Go |
| WorldofASP.NET: Tips to Improve Your ASP.NET Web site performance | ASP.NET | Go |
| RestLess - A Simple REST Framework : ndepth.net | Go |
| 47 ASP.NET MVC Resources to Rock Your Development - Craig Shoemaker | Go |
| ProgTalk - File Upload control in C# as a friendly web user control. Easy upload, delete, and view options | Go |
| Clean Up ASP.NETs Head Tag With ControlAdapters | Go |
| Asp.Net | Go |
| Open Source URL Rewriter for .NET / IIS / ASP.NET | Go |
| Using jQuery to Consume ASP.NET JSON Web Services | Encosia | Go |
| CodeProject: ASP.NET Session Helper (scope, categories). Free source code and programming help | Go |
| Understanding ASP.NET View State | Go |
| Ivonna | Go |
| Scott Gu Blog Links |
| ASP.NET MVC Source Refresh Preview ... We recently opened up a new ASP.NET CodePlex Project that we will be using to provide previews (with buildable source code) for several upcoming ASP.NET features and releases. Last month we used it to publish the first drop of the ASP.NET MVC source code . This first drop included the source for the ASP.NET MVC Preview 2 release that we shipped at MIX, along with Visual Studio project files to enable you to patch and build it yourself. A few hours ago we published a refresh of the ASP.NET MVC source code on the site. This source refresh is not an official new ASP.NET MVC preview release - instead it is an interim drop that provides a look at the current state of the source tree. We will ship the official "ASP.NET MVC Preview 3" release in a few weeks after we finish up some more work (more features and tweaks to existing ones, better VS tool integration, VS express edition support, documentation, etc). If you are someone who wants a hassle-free installation of ASP.NET MVC to use that ships with documentation and full tool support you'll probably want to wait for this official preview release. If you are someone who wants a chance to see an early "preview of the preview" and have the opportunity to start using and giving feedback on some of the features immediately, today's source refresh is probably interesting to look at. Improvements with this ASP.NET MVC Source Refresh This week's update (which you can download here ) includes a number of improvements to ASP.NET MVC. Some of these include: In addition to posting the source code for the ASP.NET MVC framework, we are also posting the source code for the unit tests that we use to test it. These tests are implemented using MSTest and the open source Moq mocking framework. A VS 2008 project file for the unit tests is included to make it easy to build and run them locally within your VS 2008 IDE. Significantly easier support for testing Controller classes. You can now unit test common Controller scenarios without having to mock any objects (more details on how this works below). Several nice feature additions and usability improvements to the URL routing system (more details below). Creating a New ASP.NET MVC Project You can build your own copy of the ASP.NET MVC assemblies by downloading the MVC source and compiling it locally, or alternatively you can download a VS Template package to get a pre-built version of them along with a Visual Studio project template that you can use to quickly build a new ASP.NET MVC Project that uses the latest bits. After you install the ASP.NET MVC source refresh .VSI template, a new "ASP.NET MVC Application" project template will show up under the "My Templates" section of your "New Project" dialog: This new "My Templates" version of the MVC project template lives side-by-side with the previous ASP.NET MVC Preview 2 release (which you can see above it in the main project templates section of the dialog). This allows you to safely create new projects and and use both the latest source version and the last official preview version on the same machine. When you create a new project using this updated ASP.NET MVC Project template you'll by default get a project that looks like below: This new project solution contains one Controller ("HomeController") under the "\Controllers" directory and two View templates ("About" and "Index") under the "\Views\Home" sub-directory. Both view templates are based on a common master page for the site ("Site.master"), all of whose styles are defined within a "Site.css" file under the "\Content" directory. When you run the application the built-in web-server will automatically start up and you'll see the site's "Home" content: Clicking the "About us" tab will then display the "About" content: The "HomeController" class in the project is responsible for handling both of the URLs above and has two action methods like below: The default "Site.master" templat | Go |
| April 11th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, 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 More ASP.NET Security Tutorials : The last three of Scott Mitchell's excellent ASP.NET security tutorials . His final three articles cover how to select user accounts, recover and change passwords, and unlock and approve user accounts. Building a VS 2008 Styled Grid with the ListView and DataPager Controls : Matt Berseth has a great article that talks about techniques you can use with the new ASP.NET 3.5 ListView control to create a nicely styled Grid UI - while preserving total control over the HTML and CSS used. Also read his follow-up post here that talks about how to achieve the same UI with the GridView control. 50 Useful CSS Tips and Tricks: A useful page that provides a nice listing of various CSS tips, tricks and tools you can use for common web scenarios. Using a DataPager with the GridView Control - Implementing IPageableItemContainer : Matt Berseth has a cool article that shows how to use the new IPageableItemContainer interface to implement paging support with the new ASP.NET 3.5 DataPager control. ASP.NET AJAX Accessible UpdatePanel : Bertrand Le Roy from the ASP.NET team has an article that describes how to make the ASP.NET AJAX's UpdatePanel control accessible for screen-readers. ASP.NET AJAX Meets Virtual Earth : Alessandro Gallo, author of the excellent ASP.NET AJAX in Action book, has a nice series of articles that talks about using ASP.NET AJAX with Virtual Earth to implement mapping on your site. Faster Page Loading by Moving ASP.NET AJAX Scripts after visible content : Omar Al Zabir (the co-founder of www.PageFlakes.com ) has a great article that describes a nice technique you can use to improve the perceived loading performance of an ASP.NET AJAX page. I also highly recommend reading Omar's great Building a Web 2.0 Portal with ASP.NET 3.5 book to learn some of his other suggestions and techniques. 3 Tips for Working with ASP.NET AJAX's TabContainer Control : Matt Berseth continues his great articles on ASP.NET AJAX with some tips on working with the TabContainer control in the ASP.NET AJAX Control Toolkit. Building ASP.NET AJAX Components: Mike Ormond has written an excellent 8-part series that covers building re-usable ASP.NET AJAX components that work on both the client and server. ASP.NET MVC An Introduction to ASP.NET MVC using VB : Bill Burrows from www.MyVBprof.com has put together a great set of online videos that introduce ASP.NET MVC using Visual Basic. Also make sure to check out his video series on LINQ to XML using VB and LINQ to SQL using VB . ASP.NET MVC: Membership Starter Kit : Troy Goode has a built an awesome membership starter kit for ASP.NET MVC that provides registration and login pages for users to authenticate on your site, as well as a set of administration functionality that allows admins to create/manage users and roles. Download it here . ASP.NET MVC: Action Filter for Handling Errors : Troy Goode has another good post that provides some ASP.NET MVC action filters for catching and handling runtime errors. How to Enable Pretty URLs with ASP.NET MVC and IIS6: James Geurts posts a useful article that describes how to enable extension-less URLs with ASP.NET MVC on IIS6 (note: you do not need to configure anything special with ASP.NET MVC on IIS7 to enable extension-less URL support). Visual Studio PowerCommands for Visual Studio 2008 : A free set of useful extensions for VS 2008 that add a bunch of cool features to the IDE. Coding Productivity: Macros, Shortcuts and Snippets : Kirill Osenkov has a nice blog post that shows of how to use Visual Studio's macro feature to custom record useful time-savers. Silverlight Dave Campbell's Excellent Silverlight Link Series : Dave Campbell posts a regular series of links to new Silverlight articles and conte | Go |
| ASP.NET Dynamic Data Preview Available ... A few months ago we released an ASP.NET 3.5 Extensions Preview that contained a bunch of new features that will be shipping later this year (including ASP.NET AJAX Improvements, ASP.NET MVC, ASP.NET Silverlight Support, and ASP.NET Dynamic Data). The ASP.NET Dynamic Data support within that preview provided a first look at a cool new feature that enables you to quickly build data driven web-sites that work against a LINQ to SQL or LINQ to Entities object model. ASP.NET Dynamic Data allows you to automatically render fully functional data entry and reporting pages that are dynamically constructed from your ORM data model meta-data. In addition to supporting a dynamic rendering mode, it also allows you to optionally override and customize any of the view templates using any HTML or code you want (given you full control of the experience). ASP.NET Dynamic Data Preview Today we released an updated ASP.NET Dynamic Data Preview. You can learn more about it and download it here . This new dynamic data preview now works with the standard built-in ASP.NET data controls (GridView, ListView, FormView, DetailsView, etc). The dynamic data support enables these controls to automatically handle foreign-key relationships. For example, on a gridview you'll now get automatic friendly name display of foreign key column values and automatic drop-down list selection support of these values when in edit mode: The new dynamic data support also provides automatic UI validation support (both client-side and server-side) based on the constraints you set on your data model classes. For example, if a column in the database is limited to 50 characters in size, and is marked as non-nullable, appropriate UI control validators will automatically be applied by ASP.NET dynamic data to enforce this constraint in the UI pages as well. If you change the constraints within your LINQ to SQL or LINQ to Entities data model classes, the UI will automatically pick up these changes and enforce the new constraints on the next web request. In addition to standard data model metadata, you can also declare custom metadata to further control validation and the default display of UI of objects. You will be able to use all of the above features with both LINQ to SQL and LINQ to Entities. Visual Studio Dynamic Data Project Wizard In addition to the core ASP.NET dynamic data runtime support, the VS web tools team today also shipped a first preview of a new dynamic data project wizard that enables you to quickly get a data driven web-site started. The wizard allows you to select a database, and then the tables, views and sprocs within it that you want to build a LINQ to SQL data model around: After creating a data model, the wizard allows you to easily choose dynamic data driven template pages to build UI around it: You can then choose what type of inserting/editing/updating UI is supported on each page: And when you click finish it will setup a project with your data model classes and data UI pages setup to run. You can learn more about the wizard and watch it in action in a blog post and screencast here . How to Get Started You can learn more about this new dynamic data preview and download and run it locally here . You can watch David Ebbo's dynamic data presentation at MIX 08 to learn more about how it works. Also check out Scott Hunter's screen-cast here , and Brad Millington's screen cast here . David also has a post here that talks about the changes made between the December preview and today's preview release. You can ask questions and submit feedback via the www.asp.net forums here . Hope this helps, Scott | Go |
| Tip/Trick: Creating and Using Silverlight and WPF User Controls ... One of the fundamental design goals of Silverlight and WPF is to enable developers to be able to easily encapsulate UI functionality into re-usable controls. You can implement new custom controls by deriving a class from one of the existing Control classes (either a Control base class or from a control like TextBox, Button, etc). Alternatively you can create re-usable User Controls - which make it easy to use a XAML markup file to compose a control's UI (and which makes them super easy to build). In Part 6 of my Digg.com tutorial blog series I showed how to create a new user control using VS 2008's "Add New Item" project item dialog and by then defining UI within it. This approach works great when you know up front that you want to encapsulate UI in a user control. You can also use the same technique with Expression Blend. Taking Existing UI and Encapsulating it as a User Control Sometimes you don't always know you want to encapsulate some UI functionality as a re-usable user control until after you've already started defining it on a parent page or control. For example, we might be working on a form where we want to enable a user to enter shipping and billing information. We might begin by creating some UI to encapsulate the address information. To-do this we could add a <border> control to the page, nest a grid layout panel inside it (with 2 columns and 4 rows), and then place labels and textbox controls within it: After carefully laying it all out, we might realize "hey - we are going to use the exact same UI for the billing address as well, maybe we should create a re-usable address user control so that we can avoid repeating ourselves". We could use the "add new item" project template approach to create a blank new user control and then copy/paste the above UI contents into it. An even faster trick that we can use within Blend, though, is to just select the controls we want to encapsulate as a user control in the designer, and then "right click" and choose the "Make Control" menu option: When we select the "Make Control" menu item, Blend will prompt us for the name of a new user control to create: We'll name it "AddressUserControl" and hit ok. This will cause Blend to create a new user control that contains the content we selected: When we do a re-build of the project and go back to the original page, we'll see the same UI as before - except that the address UI is now encapsulated inside the AddressUserControl: We could name this first AddressUserControl "ShippingAddress" and then add a second instance of the user control to the page to record the billing address (we'll name this second control instance "BillingAddress"): And now if we want to change the look of our addresses, we can do it in a single place and have it apply for both the shipping and billing information. Data Binding Address Objects to our AddressUserControl Now that we have some user controls that encapsulate our Address UI, let's create an Address data model class that we can use to bind them against. We'll define the class like below (taking advantage of the new automatic properties language feature): Within the code-behind file of our Page.xaml file we can then instantiate two instances of our Address object - one for the shipping address and one for the billing address (for the purposes of this sample we'll populate them with dummy data). We'll then programmatically bind the Address objects to our AddressUserControls on the page. We'll do that by setting the "DataContext" property on each user control to the appropriate shipping or billing address data model instance: Our last step will be to declaratively add {Binding} statements within our AddressUserControl.xaml file that will setup two-way databinding relationships between the "Text" properties of the TextBox controls within the user control and the properties on the Address data model object that we attached to the user control: W | Go |
| Unit Testing with Silverlight ... One of the important capabilities we shipped with the Beta1 release of Silverlight 2 was a unit test harness that enables you to perform both API-level and UI-level unit testing. This testing harness is cross browser and cross platform, and can be used to quickly run and verify automated unit tests: In addition to shipping this unit test harness for Silverlight, we also shipped the source to ~2,000 unit tests built with it that provide automated coverage for the Silverlight control source that we also shipped under a permissive license (you can take the control source, modify it, run the unit tests to verify the behavior, then re-ship the controls however you want). Learning How to Unit Test Silverlight Jeff Wilcox (who developed the Silverlight unit test framework and harness) has a great blog post that talks about how to add a Silverlight Unit Test project to a solution here . You can download the chat application that he shows testing from this expression blend blog post tutorial I did last month. You can also watch this cool video post that Jeff created where he walks through the unit test framework and test cases we've shipped. As Jeff shows in his post, you can now add a "Silverlight Test Project" to your Visual Studio solution which encapsulates unit tests for an application you are working on: You can then add unit test classes to the test project that test APIs or simulate UI action within the Silverlight controls (simulate button clicks, etc). You can then run the test project and execute the tests within it to verify and report their status. Jeff's test framework automatically provides a browser based test harness and reporting system (which means you can run it on any browser/OS combination that Silverlight runs on): Jeff's test framework supports quickly re-setting controls after each test (and avoids needing to re-launch a new browser instance for each test cases - which makes it really fast). You can quickly rip through hundreds or thousands of automated tests in seconds: Green results mean the tests passed. Red results flag that a test case failed and log the assertion failure and/or runtime exceptions that occurred. Summary If you've ever struggled to try and come up with a strategy for doing automated unit testing or TDD with AJAX applications, I think you'll find Silverlight provides some much nicer test options. Using Visual Studio you can also separate your tests into a separate project in your solution, and you do not need to embed the tests within your Silverlight application in order for them to run. In addition to supporting the above unit test harness and framework, we are also going to support UI automation APIs with the final release of Silverlight 2. These will enable accessibility scenarios (allowing screen readers to work with Silverlight and enable Section 508 compliance of Silverlight applications). These UI automation APIs will also enable UI testing scenarios where you can build end to end browser UI automation that simulates real mouse and keyboard interactions and enables automated end to end experience testing. The combination should enable you to build much more solid and maintainable RIA solutions. Hope this helps, Scott P.S. For more tutorial posts and links on Silverlight 2, check out my new "Silverlight Tips, Tricks, Tutorials and Links" page. | Go |
| March 28th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC, Visual Studio, Silverlight, .NET ... Here is the latest in my link-listing series . Also check out my ASP.NET Tips, Tricks and Tutorials page for links to popular articles I've done myself in the past. ASP.NET Three New ASP.NET Security Tutorials Now Available : Scott Mitchell continues his great ASP.NET security tutorials . These three new ones cover creating and managing roles, assigning roles to users, and implementing role based authorization. You can also find more security articles by reading posts on my blog tagged with security . .NET Libraries to Digg, Flickr, Facebook, YouTube, Twitter, and other Web 2.0 APIs : Scott Hanselman's latest "weekly source code" review looks at .NET APIs that you can use to call popular web 2.0 services. Hangs and how to Solve Them (Part 1) and (Part 2) : Tom has some useful posts that talk about deadlocks and request queuing in ASP.NET, and how to detect and debug what might be causing them. ASP.NET AJAX Building ASP.NET AJAX Controls (Part 1) , (Part 2) , and (Part 3) : Mike Ormond has started a nice blog post series that talks about how to build ASP.NET AJAX Controls. Make sure to check out Part 2 - Components and Part 3 - Properties and Events as well. New ASP.NET AJAX "How Do I?" Videos : Joe Stagner has published a number of new ASP.NET AJAX "How Do I?" videos. Learn about the re-order control , retrieving values from server-side AJAX controls , two techniques for triggering updates to update panels , and using the cascading drop down control . Real-Time Progress Bar with ASP.NET AJAX: SingingEels shows a technique for displaying real-time progress notifications using AJAX as a long-lived activity runs on the server. Using JQuery to Consume ASP.NET AJAX JSON Web Services : Dave Ward has a nice post that describes how to use the JQuery AJAX library on the client to call an ASP.NET Web Service on the server that is JSON enabled (using ASP.NET AJAX on the server). ASP.NET MVC Kigg - Building a Digg Clone with ASP.NET MVC : Kazi Manzur Rashid published an excellent Digg-clone sample built with ASP.NET MVC last February. He recently updated the code to work with ASP.NET MVC Preview 2 (full details here ). You can download the latest version of his source code here . ASP.NET MVC In-Depth: The Life of an ASP.NET Request : Stephen Walther has a great post that details the exact steps that occur when an ASP.NET MVC request executes. ASP.NET MVC Action Filters - Caching and Compression : Kazi Manzur Rashid has another great post that shows how to use the new ActionFilterAttribute support in ASP.NET MVC to implement output caching and compression attributes. Read this quickstart article to learn more about how Action Filters work, or watch Scott Hanselman's video that covers them. Defining Routes using Regular Expressions with ASP.NET MVC : Someone asked me the other day how to use regular expressions to define route rules with ASP.NET MVC. Turns out Fredrik Kalseth already has a nice sample that shows how to-do this. Testing with the ASP.NET MVC Framework : Simone Chiaretta has a great article that discusses how to test controllers using ASP.NET MVC Preview 2. Note: the next ASP.NET MVC preview release will include a number of refactorings that will simplify controller testing considerably (and avoid the need to mock anything for common scenarios). Test-Driven Development with Visual Studio 2008 Unit Tests : Stephen Walther has a really nice post that describe how the unit testing features now built-in VS 2008 Professional work (using an ASP.NET MVC project). Also check out Stephen's excellent Introduction to Rhino Mocks blog post that describes how to use the open source Rhino Mocks framework with VS unit test projects. Visual Studio VS 2008 Web Deployment Hot-Fix Roll-Up Now Available for non-English Languages: Last month we shipped a hot-fix release that fixes a number of bugs, adds a few features, and improves performance for web development scenarios in VS 200 | Go |
| New Log Reporting, Database Management, and other cool admin modules for IIS 7 ... One of the core priorities we focused on when building IIS 7 was to enable a rich .NET extensibility model that provides developers with the hooks to easily plug-in and extend the web server. These extensibility hooks are provided in the web-server pipeline (enabling scenarios like the new IIS7 Bit Rate Throttler ), within the configuration system (enabling developers to create new web.config schema settings), within the health monitoring system (enabling developers to add custom trace events), and within the admin tool (enabling developers to plug-in new admin UI modules). We added these extensibility hooks so that anyone can easily extend and enhance the web server using .NET. We also selfishly wanted them so that we can ship regular feature packs that add additional features to the core web server. IIS 7 Admin Pack Preview 1 Released Last week the IIS team shipped the first technical preview of some really cool administration modules that I think web developers will find super useful. This preview adds several new features to the IIS7 Admin Tool: Database Manager : Built-in SQL Server database management, including the ability to create, delete, and edit tables and indexes, create/edit SPROCs and execute custom queries. Because it is integrated in the IIS administration tool it all works over HTTP/SSL - which means you can use the module to remotely manage your hosted applications (even with low-cost shared hosting accounts), without having to expose your database directly on the Internet. Log Reports : Built-in report visualization with charting support for log files data. Full range selection and custom chart creation is supported, as well as the ability to print or save reports. Like the database manager you can use this module remotely over HTTP/SSL - which means it works in remote shared hosting scenarios. Configuration Editor: This is a power module that provides complete control over editing all web.config settings within the admin tool. You can configure it to track the changes you make using the UI and have it auto-generate configuration change scripts that you can then save and tweak to re-run later in an automated way. Request Filtering UI: This admin module provides more control over the new request filtering feature in IIS7. Check out Carlos' blog post here for details on how to use it. .NET Authorization: This admin module provides a custom authorization rules editor which allows you to more easily manage the ASP.NET <authorization> configuration section. FastCGI UI: This admin module provides more support for editing all the new <fastCGI> settings (for when you use FastCGI modules with IIS7 like PHP). Below are some screen-shots and simple walkthroughs of the Log Reporting and Database Manager administration UI modules: Log Reporting Admin Module Have you ever deployed a web application onto a server and wondered how much load it is getting?, what the average response time from the server is?, or whether many server errors are occurring (and if so on what URLs)? All of these settings are carefully logged by IIS in a text based log file. Today most people use command-line tools like the IIS Log Parser utility to query and analyze these files. The IIS 7 Admin Pack and the new "IIS Reports" admin module now enable you to also query and chart your reports graphically within the IIS admin tool: Out of the box the "IIS Reports" admin module comes with a bunch of pre-built logparser-based reports that you can easily run on your sites and applications: Below is a simple graphical report we could pull up that looks at the HTTP status codes being returned by my "TestSite" application (note how we are using the "bar graph" visualization option): Reports can optionally be filtered using a date range. You can also push the print or save buttons within the report page to generate a printer or a local saved version of the report. The IIS7 Admin To | Go |
| ASP.NET MVC Source Code Now Available ... Last month I blogged about our ASP.NET MVC Roadmap . Two weeks ago we shipped the ASP.NET Preview 2 Release . Phil Haack from the ASP.NET team published a good blog post about the release here . Scott Hanselman has created a bunch of great ASP.NET MVC tutorial videos that you can watch to learn more about it here .
One of the things I mentioned in my MVC roadmap post was that we would be publishing the source code for the ASP.NET MVC Framework, and enable it to be easily built, debugged, and patched (so that you can work around any bugs you encounter without having to wait for the next preview refresh release).
Today we opened up a new ASP.NET CodePlex project that we'll be using to share buildable source for multiple upcoming ASP.NET releases. You can now directly download buildable source and project files for the ASP.NET MVC Preview 2 release here .
Building the ASP.NET MVC Framework
You can download a .zip file containing the source code for the ASP.NET MVC Framework for the release page here . When you extract the .zip file you can drill into its "MVC" sub-folder to find a VS 2008 solution file for the project:
Double-clicking it will open the MVC project containing the MVC source within VS 2008:
When you do a build it will compile the project and output a System.Web.Mvc.dll assembly under a \bin directory at the top of the .zip directory. You can then copy this assembly into a project or application and use it.
Note: the license doesn't enable you to redistribute your custom binary version of ASP.NET MVC (we want to avoid having multiple incompatible ASP.NET MVC versions floating around and colliding with each other). But it does enable you to make fixes to the code, rebuild it, and avoid getting blocked by an interim bug you can't work around.
Next Steps
Our plans are to release regular drops of the source code going forward. We'll release source updates every time we do official preview drops. We will also release interim source refreshes in between the preview drops if you want to be able to track and build the source more frequently.
We are also hoping to ship our unit test suite for ASP.NET MVC in the future as well (right now we use an internal mocking framework within our tests, and we are still doing some work to refactor this dependency before shipping them as well).
Hope this helps,
Scott | Go |
| IIS 7.0 Bit Rate Throttling Module Released ... Video on the web is now one of those common scenarios that every user takes for granted, and increasingly every major site is incorporating in some form (product videos, training videos, richer advertising scenarios, user generated content, customer testimonials, etc).
One of the challenges when adding video to a site, though, is delivering it in a way that doesn't cost a fortune. Network bandwidth costs a lot of money, and the cost of high quality video usage can quickly add up.
The blog post below provides a quick overview of some of the options you can use to reduce the cost of delivering video, and discusses a new free download - the IIS 7.0 Bit Rate Throttling Module - that was released a few days ago and which enables you to easily save money when serving video from an IIS web server using any video technology (including Silverlight, Windows Media Player and even Flash).
Option 1: Using a Video Hosting Service
One approach you can take to reduce video bandwidth costs is to use a video hosting service like YouTube or the free Microsoft Silverlight Streaming Service . This allows you to use someone else's network to deliver the video content, and avoid having to pay the bandwidth costs yourself.
If you aren't familiar with the Silverlight Streaming service, it allows you to upload up to 10GB of videos and download 5 Terabytes/month of video content (at up to a 1.4 Mbps bit-rate) for free. You can build any custom Silverlight client player application you want to embed the video within it. This means it doesn't require a specific video player look and feel, nor a service logo/watermark to play the video. This allows you to fully integrate the video into your site and use whatever UI you want to host it.
Option 2: Hosting Video on Your Own Servers
Sometimes using a video hosting service doesn't make sense (for example: you want to use custom authentication to grant/deny user's access, you want to play really long video segments, or you want to serve up custom ads in your videos). Instead you might want to serve the video up from your own servers and have complete control over it.
There are typically two options you can use to deliver the video from your servers: using a streaming approach or a progressive video download approach:
Streaming Server Scenario
In a streaming scenario a client (like Silverlight, Windows Media Player, Flash or Real Networks) connects to a streaming server. The streaming server then sends down the video stream to watch, and typically enables a user to dynamically skip ahead/behind, pause or stop the video stream. When the user closes the browser or navigates away from the page the video stream automatically stops transmitting.
Windows Media Services (WMS) is a free streaming server download available for Windows, and can stream video to both Windows Media Player and cross-platform Silverlight browser clients. It is generally regarded as the most server scalable and cost effective way to enable video streaming on the web, and handles both on-demand file streaming scenarios (for example: streaming a .wmv file) as well as live stream scenarios (for example: a sporting event like the Olympics that is happening live in real time).
Windows Media Services can be used on any version of Windows Server - including the new Windows Server 2008 Web Server edition (which only costs $469, enables up to 4 processors and 32GB of RAM, and supports IIS, ASP.NET, SharePoint, and Windows Media Services).
Progressive Download Scenario
In a progressive download scenario a client (like Flash or Silverlight) downloads a video directly off of a web-server, and begins playing it once enough video is downloaded for it to play smoothly.
The benefit of using a progressive download approach is that it is super easy to setup on a web-server. Just copy/ftp a video up to a web-server, obtain a URL to it, and you can wire it up to a video client player. It doesn't require any custom web-server configurat | Go |
| March 14th Links: ASP.NET, ASP.NET AJAX, ASP.NET MVC and .NET ... I'm slowly recovering from keynoting at MIX last week, and have been digging my way out of backlogged email the last few days. I'm going to try and finish catching up on blog comments this weekend - apologies for the delay in getting back to some of your questions. To kick-start my blogging again I thought I'd post a new link-listing series . Today's post is mostly focused on ASP.NET and web related links. I'm going to be doing more Silverlight and WPF posts soon. ASP.NET Tag Cloud Filters with ASP.NET 3.5's LinqDataSource and ListView Controls : Matt Berseth has a cool post that shows off using LINQ to SQL and ASP.NET 3.5 to build a tag-cloud navigation UI. Five New ASP.NET Security Tutorials Now Available : Scott Mitchell continues his great ASP.NET security tutorials . These 5 new ones (all in both VB and C#) cover using the ASP.NET membership system. Building a Vista Style Folder Browser with ASP.NET 3.5 and a Custom Hierarchical DataSource Control: Matt Berseth continues his great posts with a nice one that shows how to build a custom HierarchicalDataSourceControl to implement file browsing functionality using ASP.NET. ASP.NET AJAX New ASP.NET AJAX Control Toolkit Release: David Anson blogs about a new ASP.NET AJAX Control Toolkit release that the team made right before MIX. This release includes a number of patches (including a bunch from the community) with bug fixes and improvements in a bunch of areas. LinkedIn Style Theme for the ASP.NET AJAX Tab Container Control: Matt Berseth posts some cool new themes you can use with the ASP.NET AJAX Control Toolkit's tab control. ASP.NET AJAX In-Depth: Object Inheritance : Stephen Walther, author of the recently published ASP.NET 3.5 Unleashed book , posts an incredibly in-depth article about how object inheritance is handled with ASP.NET AJAX. ASP.NET AJAX In-Depth: Creating JavaScript Properties: Stephen Walther continues his series with an in-depth article discussing how JavaScript Properties are handled with ASP.NET AJAX. ASP.NET AJAX In-Depth: Application Events : Yes another Stephen Walther article discussing how application events are handled with ASP.NET AJAX. ASP.NET AJAX Localization Slides and Code: Joel Rumerman has a nice post with samples + slides about how the localization features in ASP.NET AJAX work. JScript Intellisense: working with Ext JS : The VS web tools team enabled JQuery intellisense last month with the VS 2008 Web Development hot fix . In this more recent post they talk about enabling intellisense support for Ext JS (another popular JavaScript framework). VS 2008 Intellisense support for Prototype is coming in the next few weeks. JavaScript Intellisense for the Virtual Earth Map Control: Marc Schweigert is driving a project to add great VS 2008 JavaScript intellisense support for the Virtual Earth Map Control. Check out his video and visit his codeplex project to learn more. ASP.NET MVC ASP.NET MVC Preview 2: Last week at MIX the ASP.NET team shipped a second preview release of the ASP.NET MVC framework. This release has a number of improvements in it (see my earlier MVC roadmap post that covers some of them). Watch the Scott Hanselman videos on the http://www.asp.net/mvc page, as well as the quickstart samples to learn more. Thoughts on ASP.NET MVC Preview 2 and Beyond : Phil Haack from the ASP.NET team has a great post where he talks about the ASP.NET MVC Preview 2 release, as well as some of the features and work that will show up in the next preview drop. One of the major focuses in Preview 3 will be improvements to the testing workflow of controllers. Cheesy Northwind Sample Code: Scott Hanselman has posted a sample application that shows building a simple data driven application using the ASP.NET MVC Framework and the Northwind sample database. Securing Your Controller Actions : Rob Conery shows how to use the new ASP.NET MVC ActionFilterAttribute feature to apply declarative secu | Go |
| My Presentations in Arizona this Tuesday ... Update: You can now download the slides + demos I used during my talks. Click here for the Silverlight Talk . Click here for the MVC Talk .
This week I'm visiting Scottsdale Arizona and will be presenting at a free user group event during the day. I'm presenting two sessions myself:
1) Developing Applications using Silverlight 2 : This will be a drill-down into the new Silverlight 2 Beta1 release, and how you can build applications with it using VS 2008 and Expression Blend. You'll leave this session with a good understanding of the basics of Silverlight programming and how to start building applications with it.
2) Developing Applications using ASP.NET MVC : This session will be a drill-down into the new ASP.NET Model-View-Controller framework option (which last week was updated . You'll leave this session with a good understanding of what it is, how it works, and how to start building ASP.NET web applications with it.
In addition to my sessions above, there will also be great sessions at the event from Microsoft employees on "Consuming Web Services with Microsoft Silverlight", "Encoding Video for Microsoft Silverlight", and "Serving Applications with Microsoft Silverlight Streaming".
You can sign up and attend the sessions for free. Click here for more details on the events, and click here to register online to attend.
Hope to see some of you there,
Scott | Go |
| First Look at Using Expression Blend with Silverlight 2 ... Last week I did a First Look at Silverlight 2 post that talked about the upcoming Silverlight 2 Beta1 release. In the post I linked to some end-to-end tutorials I've written that walk through some of the fundamental programming concepts behind Silverlight and WPF, and demonstrate how to use them to build a "Digg Search Client" application using Silverlight:
Part 1: Creating "Hello World" with Silverlight 2 and VS 2008
Part 2: Using Layout Management
Part 3: Using Networking to Retrieve Data and Populate a DataGrid
Part 4: Using Style Elements to Better Encapsulate Look and Feel
Part 5: Using the ListBox and DataBinding to Display List Data
Part 6: Using User Controls to Implement Master/Details Scenarios
Part 7: Using Templates to Customize Control Look and Feel
Part 8: Creating a Digg Desktop Version of our Application using WPF
In this first set of Silverlight tutorials I didn't use a visual design tool to build the UI, and instead focused on showing the underlying XAML UI markup (which I think helps to explain the core programming concepts better). Now that we've finished covering the basics - let's explore some of the tools we can use to be even more productive.
Expression Blend Support for Silverlight
In addition to releasing the upcoming Beta1 of Silverlight 2, we are also going to ship Visual Studio 2008 and Expression Studio tool support for targeting it. These tools will offer a ton of power for building RIA solutions, and are designed to enable developers and designers to easily work on projects together.
In today's post I'm going to introduce some of the features in the upcoming Expression Blend 2.5 March preview. After demonstrating some of the basics of how Blend works, we are going to use it to build a cross-platform, cross-browser Silverlight IM chat client:
The above screen-shot shows what the application looks like at runtime on a Mac. Below is a screen-shot of what it looks like at design-time within Expression Blend:
We'll use Expression Blend to graphically construct all of the UI for the application, as well as use it to cleanly data-bind the UI to .NET classes that represent our chat session and chat messages.
<Download Code> Click here to download a completed version of this sample. </Download Code>
All of the controls we'll use to build the chat application are built into Beta1 of Silverlight 2.
Disclaimer: I am not a designer (nor am I cool)
Let me say up front that I am a developer and not a designer. I'm also not very cool. While I understand the techniques to create UI, I sometimes choose bad colors and fonts when putting it together (only after I did all the screen-shots for this post did a co-worker helpfully point out that there is actually a site dedicated to banning some of the fonts and colors I used . Ouch).
For those of you with artistic skill out there - please be gentle with me and focus your attention on the features and techniques I demonstrate below, rather than on the font and color choices I use. :-)
Getting Started: Creating a new Silverlight 2 Project
Expression Blend and Visual Studio 2008 share the same solution/project file format, which means that you can create a new Silverlight project in VS 2008 and then open it in Expression Blend, or you can create a new Silverlight project in Expression Blend and open it in VS. You can also have both Expression Blend and VS 2008 open and editing the same project as the same time.
Since in my previous Silverlight tutorial series I already showed how to create a new Silverlight project using VS 2008, let's use this post to show how to create a new Silverlight application using Expression Blend. To do this, simply choose File->New Project in Expression Blend, select the "Silverlight 2 Application" icon, and click ok:
This will create a new (VS-compatible) solution file and Silverlight application project:
Blend includes a full WYSIWYG designer for Silverlight 2 appli | Go |
| First Look at Silverlight 2 ... Last September we shipped Silverlight 1.0 for Mac and Windows , and announced our plans to deliver Silverlight on Linux. Silverlight 1.0 focused on enabling rich media scenarios in a browser, and supports a JavaScript/AJAX programming model.
We are shortly going to release the first public beta of Silverlight 2, which will be a major update of Silverlight that focuses on enabling Rich Internet Application (RIA) development. This is the first of several blog posts I'll be doing over the weeks and months ahead that talk in more depth about it.
Cross Platform / Cross Browser .NET Development
Silverlight 2 includes a cross-platform, cross-browser version of the .NET Framework, and enables a rich .NET development platform that runs in the browser. Developers can write Silverlight applications using any .NET language (including VB, C#, JavaScript, IronPython and IronRuby). We will ship Visual Studio 2008 and Expression Studio tool support that enables great developer / designer workflow and integration when building Silverlight applications.
This upcoming Beta1 release of Silverlight 2 provides a rich set of features for RIA application development. These include:
WPF UI Framework : Silverlight 2 includes a rich WPF-based 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. This upcoming Beta1 release includes core form controls (TextBox, CheckBox, RadioButton, 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). The built-in 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). Beta1 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 also 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.
Silverlight 2 does not require the .NET Framework to be installed on a computer in order to run. The Silverlight setup download includes everything necessary to enable all the above features (and more we'll be talking about shortly) on a vanilla Mac OSX or Windows machine.
The Beta1 release of Silverlight 2 is 4.3MB in size, and takes 4-10 seconds to install on a machine that doesn't already have it. Once Silverlight 2 is installed you can browse the Web and automatically run rich Silverlight applications within your browser of choice (IE, FireFox, Safari, etc).
Silverlight 2 Tutorials: Building A Simple Digg Client
To help people come up to speed with Silverlight 2, I wrote a Silverlight application and put to | Go |
| .NET 3.5 Client Product Roadmap ... A few months ago I did a .NET Web Product Roadmap blog post where I outlined some of the product plans we have to build on top of the web development features we’ve shipped with Visual Studio 2008 and .NET 3.5. Over the next few months we will also be releasing a number of enhancements specific to client development as well. We have put a lot of effort into addressing some of the biggest areas of customer feedback, while also trying to really push the envelope on the capabilities developers have when building Windows applications. All of these improvements build on top of VS 2008 and .NET 3.5, and will make .NET client development even better going forward. Below is a roadmap of some of the upcoming releases we have planned for the months ahead: Improved .NET Framework Setup for Client Applications One of the biggest asks we’ve had over the years from customers and ISVs building client applications is to make the setup and installation of the .NET Framework easier and faster. This summer we are going to ship a new setup framework for .NET that makes it easier to build optimized setup packages for client applications. This setup framework can be integrated with existing installation frameworks (for example: products like InstallShield), and enables a smaller and faster end-user setup experience of the .NET Framework. Windows Forms and WPF client applications will be able to use this setup framework to cleanly “bootstrap” getting the .NET Framework installed onto machines. The setup “bootstrap” utility will support automatically downloading the minimal set of .NET Framework packages needed to enable .NET 3.5 client applications on a machine. For example, if a user already has .NET 2.0 installed on their machine, setup will be smart enough to automatically download only the upgrade patches necessary to update .NET 2.0 to 3.5 (and not have to re-download the components already provided by .NET 2.0). This will significantly shrink the payload size of client setup programs, and speed up the installation experience. We’ll also be delivering improvements that enable a more integrated application install experience for both MSI and ClickOnce based solutions, and support a more consumer friendly user experience that is easy to build. Improved Working Set and Startup Improvements for .NET Client Applications One of the other common asks we receive is to enable .NET client applications to launch faster in “cold startup” scenarios. “Cold startup” scenarios occur when no other .NET client applications are running (or have recently run) on a machine, and require the OS to load lots of pages (code, static data, registry, etc) from disk. If you are loading a large .NET client application or library, or are using a slow disk, these cold startup scenarios can require many seconds for your application to start. This summer we are going to ship a servicing update to the CLR that makes some significant internal optimizations in how we optimize our data structures to cut down on disk IO and improve memory layout when loading and running applications. Among many other benefits, this work will significantly improve the working set and cold startup performance of .NET 2.0, 3.0 and 3.5 applications and will dramatically improve end-user experiences with .NET-based client applications. Depending on the size of the application, we expect .NET applications to realize a cold startup performance improvement of between 25-40%. Applications do not need to change any code, nor be recompiled, in order to take advantage of these improvements so the benefits are automatic. WPF Performance Improvements This summer we are also planning to release a servicing update to WPF that includes a bunch of performance optimizations that improve its text, graphics, media and data stack. These include: - Moving the DropShadow and Blur bitmap effects, which are currently software rendered, to be hardware acc | Go |
| ASP.net.com Community Links |
| How to call Server-Side function from Client-Side Code Using PageMethods in ASP.NET AJAX ... You cannot call server-side code ‘directly’ from client-side code. However, there are some workarounds. To call server-side code from Javascript, you will need to use AJAX, and the easiest way out is to use the ASP.NET AJAX Extensions. In this article, we will be using PageMethods to call server-side functions using Javascript. | Go |
| How to Create Your Own Auto Suggest Textbox Without Any AJAX Frameworks ... We will use basic Javascript and .NET to create a feature to allow auto suggests as a user types. | Go |
| Using Design Time Attributes ... Developing a nice custom control is just one part of the story. You can enhance the experience of other developers using your control by providing proper designer support. A set of attributes often called as Design Time Attributes allow you to accomplish this. | Go |
| Dissecting LINQ to SQL ... Where LINQ to SQL shines as compared to other ORM tools in the market is the fact that it abstracts away the database structure behind our business objects, it also supports a query language called LINQ. The article talks about LINQ to SQL execution plans and how it manages its object state. | Go |
| Using Syndication Classes to Read RSS Feeds ... RSS and ATOM feeds dominate the syndication systems today. If you run a web site you probably use RSS and ATOM for two purposes:
1) Expose your site content for syndication using these formats
2) Consume content exposed by other web sites and aggregate it on your web site
Whatever be the case until recently developers either coded their custom solution or made use of some third party component. Luckily .NET framework 3.5 introduced a set of classes that can simplify your job. This article explains how. | Go |
| Client Application Services - Part 1 ... In this first part of the three part series, Bilal Haidar introduces Client Application Services (CLAS) that shipped with Visual Studio 2008 and .NET 3.5. These services allow Windows Forms and Windows Presentation Foundation applications to access ASP.NET 2.0 AJAX 1.0 Extensions Application Services. He begins with a brief introduction followed by a detailed discussion of ASP.NET 2.0, AJAX Extensions 1.0, and Client Application Services. He concludes the article by providing a list of classes used for CLAS. | Go |
| File Upload control in C# as a friendly web user control. Easy upload, delete, and view options ... Web User control written in C# using VS2005 to allow file upload, delete, and view option. Easy property settings, makes it easier for developers to use. | Go |
| ASP.NET MVC Framework – Part 2: Testing ... In this article Simone will cover one of the main reasons for adopting the ASP.NET MVC framework: testability. | Go |
| Create Control Extenders ... Learn how to create Control Extenders using Visual Studio 2008, ASP.NET 3.5, and AJAX. | Go |
| GridView with Expandable/Collapsable Rows ... Using C# and Javascript to show gridview rows with expanded and collapse features. Allows parent/child view while providing easy navigation of child details using client side script. | Go |
| CodeProject.com ASP Links |
| Easy, proficient and generic Web form validations ... Generic web form validations that can be used in all web forms | Go |
| Search User Controls for Microsoft Office SharePoint Server (MOSS) ... A set of user controls to provide Microsoft Office SharePoint Server (MOSS) search functionality | Go |
| Navigation Custom Control for Microsoft Office SharePoint Server (MOSS) ... Renders navigational nodes using list tags. | Go |
| WPSC in MOSS2007 - "Cannot retrieve properties at this time. " ... How does WPSC register web part differ from SharePoint 2003. | Go |
| An introduction to using a DataGrid control in Silverlight 2.0 ... An introduction to using the DataGrid control in Silverlight 2.0. | Go |
| MultiThread in MOSS Page by implementing PageAsyncTask ... To implement PageAsyncTask for web part rendering in Parallel instead of RegisterWorkItem | Go |
| United States Postal Service (USPS) Web Tools Wrapper ... United States Postal Service (USPS) Web Tools Wrapper is a .NET library you can use for address validation, retrieving rates and YES even printing label. | Go |
| GridViewImages from DB in ASP.NET using C# ... GridViewImages from DB in ASP.NET using C# | Go |
| Schemaless C#-XML data binding with VTD-XML ... Agile, efficient XML data binding without schema | Go |
| Providing Web Applications with Context Sensitive Help Using RoboHelp WebHelp ... This article shows how to implement context sensitive help for your ASP.NET web applications using RoboHelp WebHelp. | Go |
| Multiple File Upload User Control ... This article describes how to create a user control with event & properties. | Go |
| Networking in Silverlight and WPF or how to make them speak one each other ... How to use raw sockets in Silverlight application and how to make silverlight to speak with windows forms and wpf | Go |
| JSBasic - a BASIC to JavaScript compiler ... In this C#-project BASIC source code is compiled to JavaScript and run in a browser. | Go |
| About GridView, HyperLinkField, UrlEncode ... Tired of converting HyperLinkField into TemplateField in order to solve UrlEncode? It is right for you. | Go |
| DotNetSlackers.com Links |
| GridViewImages from DB in ASP.NET using C# ... GridViewImages from DB in ASP.NET using C#... 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 |
| Providing Web Applications with Context Sensitive Help Using RoboHelp WebHelp ... This article shows how to implement context sensitive help for your ASP.NET web applications using RoboHelp WebHelp.... 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 |
| SEO & ASP.NET: How content is linked really does matter ... See the first post in this series Tip #2 - How people link to you really does matter Have you ever taken the time to look at all the different ways you link to your content? For ASP.NET developers there are typically 3 ways to link to the default page (usually default.aspx). For example, let's say there is a landing page in your site for "Products" under the directory /products with a default.aspx page. Therefor you could link to it as: example.com/products example.com/products/ example.com/products/default.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 Quick `n Dirty Exception Logging* ... If you need an easy way to handle logging exceptions in your ASP.NET web application but want to avoid all the complexities of using a logging library and / or setting up all the database "Stuff", here is an easy way to handle it: In web.config: <appSettings> <add key="logExceptions" value="true"/> </appSettings > <system.web> In Global.asax.cs: public class Global : System.Web.HttpApplication { ... 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 |
| Search Engine Optimization (SEO) for ASP.NET Developers ... I recently put together a presentation for a developer conference about SEO for ASP.NET Developers. I was a little surprised at how little content there was when I researched this topic. There was a lot of great content about SEO, but only a handful of articles for developers. I've decided to take my talk and convert it into a series of blog posts about SEO for ASP.NET. As it turns out about 50% of it actually requires technical understanding of ASP.NET - a lot of SEO goodness can be achieved without... 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 |
| NTM: How to send email using Exchange in ASP.NET ... I always forget how to send emails using exchange, so I thought to put it on a post for me to find it when I need it.<system.net>
<mailSettings><smtp>
<network host="exchangeServer" username=userName@mydomain.com password="password" /></smtp> </mailSettings>
</system.net>
Cheers
Al... 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 |
| DevConnections Slides and Demos ... Below are links to the slides and demos I presented April 2008 at DevConnections: ASP.NET Internals ASP.NET Search Engine Optimization ASP.NET Performance Tips & Tricks... 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 |
| How to create an Http Handle to re write the URL ... This question keeps coming back to the ASP.NET forums, people wanting to write an Http Handler to re write the url. This is a common use in blogs and forums, when people wants to redirect from URL /blog/1093/post.aspx to /blog/post.aspx?id=1093 however keep the previous displayed for better url usage. Create a class on the project and inherit from IHttpHandler public class MyHandler : IHttpHandler Right click the IHttpHander and select "Implement Interface" to create the method... 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 |
| Explicitly binding data to ListView web control ... Binding data without ObjectDataSource and Eval / Bind methods... 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 |
| MvcContrib release now works with 4/16 MVC Framework drop ... MvcContrib is upgraded to account for the recent changes with the ASP.NET MVC Framework. Eric Hexter has more details.
... 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 |
| The dark side of static members ... Often we find it easy to create a class with a static event to keep the controls in our web application loosely coupled. The easiest way to make a number of controls interact without "knowing" about each other is to have a static event distributor class.
public class EventDistributor
{
public static event EventHandler SomethingHappened;
public static void RaiseSomethingHappened(object sender, EventArgs e)
{
if (SomethingHappened != null)
{
SomethingHappened(sender, e);
}
}
}
Some of the controls raise the events of the distributor.
protected void Button1_Click(object sender, EventArgs e)
{
.
EventDistributor.RaiseSomethingHappened(sender, e);
.
}
.and others subscribe to them
protected void Page_Load(object sender, EventArgs e)
{
EventDistributor.SomethingHappened += new EventHandler(EventDistributor_SomethingHappened);
.
}
The problem
Let's say we add an IScriptControl (e.g. from the RadControls for ASP.NET AJAX suite) in the control tree inside the event handler of the static event. After postback we get an InvalidOperationException with the message "Script controls may not be registered after PreRender".
The reason
To find the reason for the error we need to know that static classes and members are alive until the application is restarted. They are not destroyed after the page lifecycle completes. So what happens? A control subscribes to the event of the event distributor in the Page_Load handler. After the postback the event is raised and the control's event handler method from the first request gets executed. The life cycle of that previous page was already executed and adding a RadControl to the Controls tree will throw the aforementioned exception. This exception is thrown by the ScriptManager control which cannot register script controls after the Prerender event of the Page object.
There is one more problem here - the event distributor holds a reference to the user control and thus it cannot be garbage collected. This leads to a memory leak on the server.
The solution
What we need to do is guarantee that the event distributor does not keep a reference to our object. This can be done easily by detaching the event handler in a later stage of the page lifecycle. Still, this is not the best approach. As the static members are alive as long as the application is, it is possible that concurrent requests to the same page execute simultaneously. This will raise the event twice for both page instances and will execute their event handler methods twice. We can avoid that by making sure our class is page-specific. We can create a singleton static class, which is stored in the Items collection of the Page object and use it. The singleton will be destroyed when the page gets destroyed, so we even do not need the code to remove the event handler.
I'm attaching a demo project to this post. It contains two folders - one of them contains a page, demonstrating the problem and the other contains the suggested solution.
P.S. Tess Ferrandez , Microsoft Escalation Engineer describes another drawback of using static members.
Cheers,
Erjan
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 Session Helper (scope, categories) ... Use scopes and categories to avoid collision and confusion between you session values... 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 few issues installing MVC release 4/16/2008 ... Are you already tied of hearing ASP.NET MVC? Microsoft first open source is getting lots of blogging time for the reason that they are adding lots of value for us to decide how would you like to code, instead of going to another Open Source initiative. And that believe it or not is a good thing. I downloaded and install the VS template package with the version 4/16/2008 In a clean computer, Still I received the error below. Having said that the install said successfully. After creating... 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 AJAX Web Site - Kleenex.com ... We just launched the site earlier this week. It uses ASP.NET AJAX as well as jQuery for the dynamic UI used throughout the site.Kleenex.com ... 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 |
| ASP.NET MVC - Legacy Url Routing ... Recently, we've been converting over a lot of our ASP.NET Web Form pages to use ASP.NET MVC. While this is no small feat by itself, the underlying problem of having a new Url structure in the site while still supporting legacy Url's was necessary. The idea, is that you hit a page that no longer exists, and you get redirected to the appropriate controller & action within MVC. Workflow A legacy Url is requested from your site. For example, http://www.server.com/Users/Login.aspx ASP.NET routing intercepts the request and matches a route from your route collection Instead of using the MvcRouteHandler, a LegacyRouteHandler is invoked. Using the LegacyRouteHandler, it'll use the route redirection name you specified, generate the MVC Url, and issue a HTTP 301 with the location of http://www.server.com/site/login. Read more... | Go |
| Flickering issue with Ap.Net List box control ... Hi,
Last few days I was working on a page which had lots of list box in it which had multi select option. My master page also had a Menu control for the navigation purpose. One major problem I was facing was with the flickering of the List box as soon as take my mouse over the menu.
As soon as user takes the mouse over the menu all the list box start to flicker. This gives a very bad user experience. Setting the exact height and width and z-index of table and div did not do any good to the flicker. Then and I goggled and found that only way to deal with this issue. To remove the flickering we have to use the row property and remove any height property in the list box. The row property defines how many rows will be displayed in the list box
<asp:ListBox id=lstExample runat=server Rows=3 selectionmode=Multiple></asp:ListBox>
Vikram | Go |
| Pictures from the MVP Summit 2008 ... Pictures from the MVP Summit 2008 (some from Laurent Duveau).
Link to the full album:
MVP Summit 2008
Most notables (click for larger pictures)...
Sea of red
The Montreal MVPs
And their jerseys
Going to the Summit in style
ScottGu
SteveB wearing the Canadian jersey during his keynote thanks to Barry Gervin
The French MVPs had to wear what? Looks like they weren't happy about it ;-)
However, we had so much fun with them | Go |
| Testing XML serialization attributes ... Not sure how I feel about this particular brand of testing syntax . still, it's good that someone thought this problem through - testing xml serialization attributes. [via the morning brew ] | Go |
| Parallel Builds with MSBuild ... I just learned something new: You can do parallel builds with MsBuild if you have a multi core CPU. awesome. | Go |
| Montreal VS UG: Launch of the Team System SIG ... more info at www.guvsm.net
Prochaine assemblée
Mardi 29 avril 2008
Meeting inaugural du groupe d’intérêt Team System
Survol de Visual Studio Team System et Roadmap Conférenciers: Claude Remillard, MVP Team System et Étienne Tremblay, MVP Team System Étienne Tremblay est un architecte sénior chez EDS Canada avec plus de 15 ans d'expérience en développement d'applications d'entreprises. Il a travaillé dans les industries minières et manufacturières et récemment, la gestion de configuration et outillage de développement. Il a développé un système pour surveiller la qualité dans la fabrication de voitures, un système de gestion de réclamations, un système d’opération et de surveillance de mines et un système de gestion de d'itinéraires en utilisant des modèles d'application n tiers. Tout au long de ces années il est devenu un expert en matière d'outillage de cycle de vie de développement de logiciels et a été l'un des architectes de la solution corporative Visual Studio Team System chez EDS. Cette initiative l’a amené à voyager autour du monde pour donner de la formation adaptée aux développeurs .NET d'EDS. Il a été un conférencier lors de plusieurs conférences internationales en 2005, 2006 et 2007 sur Visual Studio. Il a aussi donné une conférence virtuelle pour MSDN sur « comment adopté Visual Studio Team System ». Il représente EDS sur le Conseil Consultatif de Microsoft pour Team System. Il a été attribué le statut de MVP Team System en 2006 et 2007 et a été choisi comme juge pour la compétition internationale de Design de Logiciel de l’Imagine Cup 2007 en Corée du Sud. M. Rémillard est co-fondateur et président de la firme InCycle et a obtenu le statut de MVP Team System en 2007. Au cours de ces dernières années, M. Rémillard présente régulièrement a diverses tribunes au sujet des meilleures pratiques en gestion du cycle de vie des applications, tout autant pour le compte d’InCycle que celui de Microsoft. Précédemment, il a occupé divers postes de direction dans le secteur du développement logiciel. Il a notamment été président d’Acceleron, une société de développement de logiciels qui a mis au point et commercialisé une solution de gestion des dépenses pour laquelle près d’un demi-million de licences ont été vendues dans le monde. | Go |
| Book Review: Learning WCF ... Learning WCF
Author: Michele Leroux Bustamante Publisher: O'Reilly Media, Inc. ISBN-10: 0596101627 ISBN-13: 978-0596101626 Retail Price: $44.99 US, $58.99 CDN Publication Date: May 2007 Softcover: 582 pages Online information: Table of contents, source code URL: http://www.oreilly.com/catalog/9780596101626/ Book URL: http://www.thatindigogirl.com/
Windows Communication Foundation (WCF) is a set of .NET technologies for building and running connected systems. It unifies various technologies previously available like Web Services and .NET Remoting into a single programming model and let you build Service Oriented Architecture (SOA) applications.
“Learning WCF” is a book targeted at experienced .NET developers wanting to learn WCF from scratch. In the first chapters, the author explains what services are and the whole idea behind SOA. She then guides you thru the WCF path learning about contracts, bindings, hosting, concurrency, reliability and security. You’ll find plenty of code examples and each one is explained in details. To help you apply the WCF concepts, each chapter has a lab that you can just read or experiment with by downloading the source code. The approach in these labs is a “step by step” one and often, the author guides you thru one path then backtracks and explains you a different way to accomplish the same thing. This is very useful to get a good understanding of the technology.
Even thought the title has the word “learning” in it, the book will get plenty of mileage serving as a reference book in the future and don’t think that it’s a “light” book; most of the concepts explained are advanced ones. I often had to reread complete sections not because they were poorly written but because of the vast amount of information provided.
WCF is vast and learning it is not a simple task but thanks to Michele Leroux Bustamante’s “Learning WCF”, this process is a lot simpler. High praises for “Learning WCF”. | Go |
| TestDriven.Net 2.13: Support for Silverlight 2.0 Beta 1 ... I've just uploaded a new version of TestDriven.Net with support for Silverlight 2.0 Beta 1. Microsoft have certainly kept me on my toes as there have been lots of changes since Silverlight 1.1. I'm sorry it has taken a while! At the moment you're limited to running individual public methods (ad-hoc tests). If you need to run a suite of tests I recommend you use this in conjunction with the Silverlight Testing Framework that was released at MIX. Jeff Wilcox has posted a detailed tutorial that shows how to use the framework here . When running your tests using 'Test With > Silverlight', bear in mind that you're simply executing the test method and any test attributes (TestInitialize etc.) will be ignored. I've also included an application called 'agx.exe' that lets you run console applications using the Silverlight/CoreCLR from the command line. After you've installed TestDriven.Net you will find this standalone application here: \Program Files\TestDriven.NET 2.0\agx.exe. This is simply an application that I use for my own testing purposes that I thought other people might find useful. You can download the new version of TestDriven.Net from here . | Go |
| Data Access - The SqlDataSource Part 3 ... In the previous posts we dropped a table from the Server Explorer onto our design surface and saw how a SqlDataSource was created with T-SQL statements to populate the basic functions of our control. In the second part we replaced our T-SQL with stored procedures and saw how this can help us maintain our code. However this is method still tightly couples our presentation layer to our data layer (what there is of one). While I'm not comfortable saying this is always wrong...it's definately not always right. For RAD (rapid application development), quick prototyping and short lived specialized applications this may be sufficient for you. However if your application is going to be maintained and grow over a longer period of time, you will quickly find that the SqlDataSource will become a sticky issue.
Consider this scenario: You have a dropdown list of some value on your page that you want to populate with data from a SqlDataSource. So you write a stored procedure to return your list. You add the SqlDataSource to your page. Add your dropdown list control and bind it to your datasource and blammo...working page. Two months later a business rule has sprung up that certain values from that list will be excluded based on other conditions within the application. Let's assume for a moment that those "conditions" are unique to the user that is currently logged into your application and are not persisted in the database. Meaning that we cannot use our stored procedure to limit the result set. Now we are forced with overriding the binding behavior of our dropdown list. I personally avoid overriding the behavior of standard controls in all but the most necessary scenarios. In my view it leads to very difficult to maintain code. A 'better' solution to this is to create a business object that controls the data being returned to the application, and then the application doesn't need to do anything fancy it just binds that data to the control.
It all comes down again to seperation of concerns. The Data Access Layer (the database and objects that get data from it) does data access, the Presentation Layer (the html/windows form) presents, and the Business Logic Layer (classes that sit between the Data Access and Presentation layers) makes all the decisions. While this is what is highly desired there are practical reasons that these roles blend from time to time...the key is to limit them whenever possible. I prefer to have all my presentation layer pages (or Windows Form Elements) be as 'dumb' as possible. So in the scenario above the SqlDataSource lets us down in that regard. However, having said that there is a time and place for everything so knowing the basics of how to use them is essential.
Mark Twain said: "To the man with a hammer, everything looks like a nail." Don't let SqlDataSource be your hammer. Likewise remember that it is there and can help you with some tasks.
I'm going to leave the SqlDataSource alone for a while and in the next post I'll start discussing the ObjectDataSource and building some basic classes and show you a couple of fun and easy data access patterns. | Go |
| Visual Studio Designer not Respecting Assembly Binding Redirection ... So we recently came across an issue where Visual Studio 2005 and 2008 Designers were not respecting assembly binding redirection. Scenario We have a file which is now version 2 and stored in the GAC . So the assembly version is 2.0.0.0. We Read More......(read more ) | Go |