First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

ASP.NET

Orchard Harvest Conference in Europe: 13-14 June in Amsterdam

In the same week of the Umbarco CodeGarden in Copenhagen, the Orchard CMS project is having its first pan-European Orchard Harvest Conference 2013. June 13 - 14th, 2013 (Thursday - Friday). The event will be held in Amsterdam, Netherlands at the wonderful Tobacco Theater. We are very excited about this event and look forward to welcoming members of the Orchard Project open source community from across Europe as well as from around the globe.   For more information about the event: Orchard Harvest - European Conference 2013 Agenda ...

Finally moved my blog to Azure Web Sites

Over the last few years I had to move my blog through different hosting providers, and when in March my last hosting, EpicWin Hosting, closed business with only one month of notice I decided that I had enough of small hosting providers run by people I know, so I decided to finally make the big step and move to Azure. Unfortunately this happened during a moment in which my life is going through some big changes, and I didn’t have time and brain-power to put all my efforts into the migration, so you might have noticed that my blog...

Vote for the sessions you want to attend at the Web.NET Conference

Over the month of July, 29 speaker submitted 44 presentations' proposals. But we have only 19 slots, so even limiting to one session per speaker we will not be able to accept all the speakers that submitted a proposal. Today we are opening the voting phase: till the beginning of September you’ll be able to vote for the 5 sessions you’d like to attend to at the Web.NET Conference on the 20 October. Speakers are coming from all Europe (and beyond), like Pierre Spring from Switzerland, Niels Hartvig from Umbraco, Jakob Mattsson from Sweden, Maarten Balliauw, Kris van...

The “modern” ASP.NET web stack is fully opensource: ASP.NET MVC, Web API, ASP.NET WebPage and Razor

Still getting my head around this early morning (in Europe timezone) announcement on ScottGu’s blog: ASP.NET MVC, Web API, Razor and Open Source. Some of you might remember that almost 3 years ago the announced that ASP.NET MVC v1 was being released under the MS-PL license, thus making it opensource. That turned out to be just a source snapshot of each public release, and were not accepting contributions, so, a “partial” commitment to open source. This time is different: the source code is available from the “live” repository the ASP.NET team is working on, and they are going...

Microsoft dev stack vNext from Build

Unless you are living under a rock, you have probably heard that two days ago, at Build, Microsoft unveiled the new version of Windows, named Windows 8. Windows 8 This is revolutionary both from the consumers’ and developers’ perspectives. The UI is deeply based on the concept of the tiles of Windows Phone 7.5 “mango” and the Metro design language, and the API are now allowing applications to be written either in C#/C++ and the usual .NET/Win32, or using WinRT, basically an Object Oriented version of Win32 or, as someone says, COM done right, and C#+XAML or JavaScript+HTML/CSS....

Tips I got from the Umbraco community

I’m not a Umbraco expert, actually I never did a real website in Umbraco till now. So being a developer that tries to adopt agile methodologies and tries to remove as much “friction” as possible I was a bit disappointed by the development and deployment experience in Umbraco. But the great community compensate pretty well the missing features (at least missing for my scenario) of Umbraco, and at the end my site came out fine, and thanks to their suggestion I’m now a much better “umbraco developer”. I want to share with you some of the suggestion I received...

Now Visual Studio 2010 supports new web standards

Today the Web Platform and Tools team (I can see the influence of Mads in this) announced the release of the Web Standards Update for Microsoft Visual Studio 2010 SP1. What sits behind this cryptic name? Shouldn’t Visual Studio already support web standards? Actually, not the latest ones. In January Microsoft released the support for HTML5 in the context of intellisense and validation in VS2010 SP1, but all the other related standards, CSS3 and all the new JavaScript standards were left out of the update. With this package you will have CSS3 schema support, intellisense for...

Welcome to the WebMatrix, and my thoughts about it

When I saw the Gu writing 3 posts in a row about new technologies/products (IIS 7.5 Express, SQL Server CE 4 and Razor view engine) I knew something big was about to come. And in fact yesterday he announced the WebMatrix, a new web development stack that combines the 3 products above plus a new super-easy to use web development IDE and a new syntax for developing quick websites, called ASP.NET Web Pages. The WebMatrix First let’s share the official announcement: WebMatrix includes a complete Web development stack that integrates a Web server (IIS...

When will WebForm vs MVC become like ListView vs Repeater?

Lately I’ve been reading again lot of discussions going on about whether WebForm is a much wiser choice for developers, if it will die in favor of ASP.NET MVC, or how much ASP.NET MVC brings productivity away because it forces you to learn another framework or because it makes you think more about pattern, or name-your-other-rather-random-opinion. Even if I wrote a book about ASP.NET MVC, I’ve to say I’m getting pretty bored about this discussions: like it or not many big companies cannot afford to rebuild their whole web applications on ASP.NET MVC, even if they want the TDD...

Best of 2009: the 5 most popular posts

The end of the year is approaching and it’s time for a recap on what happened during the last 12 months. As I did in 2008 I blogged a lot about ASP.NET MVC (around 40 posts) and few about jQuery (just 6 posts), but unlike last year where the most popular posts were about jQuery, this year it’s all ASP.NET MVC. Probably that’s because the technology is more mature than it was during 2008. The most popular posts of 2009 1. 13 ASP.NET MVC extensibility points you have to know – This post goes through all the extensibility...

ASP.NET MVC ControllerFactory for Unity and the reasoning behind it

Most of the mainstream IoC containers have their own implementation of a custom controller factory for ASP.NET MVC, but Unity doesn’t. There is an implementation in the MvcContrib project, but I don’t like the way it works, so I decided to implement it myself. Unity Controller Factory After a few mail exchanges with a guys of the p&p team and with Brad Wilson I came out with the following 35 lines of code. public class UnityControllerFactory: DefaultControllerFactory { protected override IController GetControllerInstance(Type controllerType) { ...

12 ASP.NET MVC Best Practices

Last week I held two presentations about ASP.NET MVC for the new-born DotNetRomaCeStà user group in Rome. And one of them was about what I consider to be ASP.NET MVC Best Practices. The presentation was in Italian so I decided to translate my slide in English so that everybody can read them. Controller’s best practices 1 – Delete the AccountController You will never use it and it’s a super-bad practice to keep demo code in your applications. 2 – Isolate Controllers from the outside World Dependencies on the HttpContext, on data access classes, configuration, logging,...

CKEditor 3.0 is out

After a long period of development, the new major release of FCKEditor has shipped. The most notable change is the new name: it went from FCKEditor, which many people didn’t like because of its similarity to an English bad word (it was made by the initials of the project founder, Frederico Caldeira Knabben) to CKEditor where CK stands for “content & knowledge”. But obviously this is not the only change: it’s amazingly fast, it has a completely new UI, no more popup but only js modal dialogs, produces valid XHTML code (and hopefully it will not screw-up the...

11 books for a .NET Summer reading list

Now that my book is on shelves, I’m out of things to do when I come back from work. Furthermore during this year I bought or I was given quite a few interesting programming book, so I think I’ll start using my spare time to improve my skills. Here is the list of books I’m going to read, some of which I think are a must read for all .NET developers. Frontend development and JavaScript I’m a web developer at heart, and I truly believe that a web developer must know everything about Javascript, CSS and HTML....

How to use Ninject 2 with ASP.NET MVC

Ninject with ASP.NET MVC series How to use Ninject with ASP.NET MVC How to use Ninject to inject dependencies into ASP.NET MVC ActionFilters Extending Ninject to inject dependencies into Action Filters Ninject.FilterInjector v1.5: now injecting inside all filters How to use Ninject 2 with ASP.NET MVC Back in February I wrote a series of posts about Ninject and ASP.NET...

IE6 no more

In February I joined the "IE6: Do NOT want!" campaign, which was started by some big media sites in Norway: I was planning to remove the script that showed more modern browsers to the user after one week, but I kept it till now. Probably not because of me joining the campaign, but IE6 is slightly dropping. I only have stats for my blog, but the percentage of users running IE6 dropped to 8.5% of January, to the 6.4% of July. But still it's not enough: IE6 is a 8 years old browser, there is no reason to keep on using it....

How to create a DropDownList with ASP.NET MVC

The DropDownList html helper differs a bit from the standard Html helper methods, and, not surprisingly, the way it works is one of the questions I get asked the most. So in this post I’m going to dissect this method, and show you how to use it. Standard Html Helpers One of the cool features of ASP.NET MVC is the automatic binding of html form fields: all the Html helper methods will auto-magically take the default value of the form field directly from the ViewData or the view model object with the same name of the control. ...

Beginning ASP.NET MVC 1.0 available on Amazon

It's been a long journey, that started more than one year ago: today our Beginning ASP.NET MVC 1.0 book is available for purchase on Amazon US. Probably some of you, the ones which pre-ordered the book, will be receiving it soon. And in a few days (probably next week), the book will be officially available also on Amazon UK (still in pre-sale now) and later this month also on physical bookstores. If you want to have a look at what's inside the book, you can download the free chapters we made available last month, or you can just...

ASP.NET MVC T-Shirt by CodeClimber

In order to promote our book on ASP.NET MVC and to spread some love for the library itself, for the Italian ALT.NET conference I printed 40 T-Shirts similar to the one that Chad Myers created on Zazzle last year. It was quite an interesting experience, as I didn’t know how many people would have been interested in buying such “marketing” t-shirts. And it turned out that quite a few developers wanted them, as you can notice from the people in the first rows of the room. I ran out of T-Shirts, but I’m thinking...

Webcast on ASP.NET MVC (in Italian)

I’m happy to announce that my first 3 webcasts have just been published on BE-IT, the video portal of MSDN Italy. They are the first 3 of a longer series about ASP.NET MVC, and they cover: Introduction to ASP.NET MVC - level 200 ASP.NET MVC: HTML forms – level 300 ASP.NET MVC and Ajax – level 300 They are in Italian, but they are mostly screencasts of code editing inside Visual Studio, so I think even people that understand a little of Italian will...

Sneak Peek at our book Beginning ASP.NET MVC 1.0

Our Beginning ASP.NET MVC 1.0 book is going to available on Amazon and on bookstores in a month or so. But for those of you who cannot wait till the release date, I’m going to publish the table of contents: Introduction Chapter 1: The Model-View-Controller Pattern Chapter 2: ASP.NET WebForms vs. ASP.NET MVC Chapter 3: Getting Started with ASP.NET MVC Chapter 4: The Model Chapter 5: The Controller Chapter 6: The View Chapter 7: Routing ...

Two frameworks are better than one

Looking deeper into the raw data of the survey about Ajax adoption among .NET developers I found some interesting figures that show a probably different mindset you get when you start working with ASP.NET MVC. Let’s see the following table, that show the percentage of developers that use jQuery vs the MS Ajax Stack based on which web UI framework they are using.   ...

Ajax survey 2009: jQuery and MS Ajax are almost tied among .NET developers

Almost one month ago I created a survey in order to try and understand how .NET developers are using Ajax. And also to compare it with the results I collected at the end of 2007. I left the survey running a few weeks and once I received around 2500 responses I closed it: but without further ado let’s have a look at the results, and later I’ll do a more in depth analysis of the data collected. The results The most used Ajax/JS library among .NET developers is jQuery, which is used by the 71,4% of...

Using Request inside Actions: why it is a bad idea

Why can’t I use Request["id"] inside an action to get the value of the query string parameter named "id"? I was asked this questions millions of times in the talks I did about ASP.NET MVC during the last months. I also got it asked a few times from colleagues so, when yesterday a friend asked the same question on a comment on one of my latest posts, I decided that the time had come to try and clarify this with a post. The quick answer is: “Because you don’t want to have a dependency...

Survey on Ajax adoption: some quick stats

UPDATE: The survey is closed. The results are published: Ajax survey 2009: jQuery and MS Ajax are almost tied. After 3 days and a half, with a weekend and a public holiday in between, the survey about Ajax adoption among .NET developers already received 1047 responses. Here some quick stats: an incredible (in my eyes) 5% claims he is not doing Ajax development at all; the most used web frameworks is pretty obviously WebForms (89%) followed by ASP.NET MVC (38%); the most used JavaScript library is jQuery...

Survey: Ajax usage among .NET developers in 2009

UPDATE2: The survey is closed. The results are published: Ajax survey 2009: jQuery and MS Ajax are almost tied. UPDATE: I posted some quick stats after 3 days and 1050 answers received In December 2007, taking inspiration from a survey promoted by Ajaxian, I created a survey to understand in which environment .NET developers are using Ajax, in conjunction with which web framework, and which javascript libraries they are using. Here you can read the results of the survey and the analysis of the results. But long time passed, so I think it’s useful to repeat the...

Book review: ASP.NET MVC 1.0 Quickly

Now that the book I’m writing with Keyvan has gone to production (will be available in stores at the end of July), I decided to spend some time reading other programming books: I’ve got a few of them in the queue, and I’ll probably post a review of them on my blog. Quick look at the book My first review is about another book about ASP.NET MVC: ASP.NET MVC 1.0 Quickly, written by the Belgian blogger and community speaker Maarten Balliauw. This book is, as the title says, a quick overview (around 190 pages plus 50 pages...

Free Chapter of Beginning ASP.NET MVC 1.0 – Testing ASP.NET MVC Applications

It is with an unquantifiable amount of pleasure that I can announce that we have just released a free public preview chapter of our Beginning ASP.NET MVC v1.0. The name of the chapter is “Chapter 9 – Testing ASP.NET MVC Applications”. It explains how to test controllers, how to use mocking to test interactions with the Http runtime, how to refactor an application to make it testable, and also shows some TDD in action. Also, when you read it, remember that the intended audience is developers that are new to ASP.NET MVC and most likely also...

ASP.NET MVC brings FUN back inside web development, on .NET

That’s the main fact about ASP.NET MVC: “ASP.NET MVC brings the web back inside web development” [from a tweet by Hadi Hariri] With ASP.NET MVC the “real” web is back into the development workflow of a web application. And to me this translates in having more fun developing apps, and, at the end of the day, being more productive since I don’t have to work-around issues of a framework that takes too much of my work. It’s true: some might say that ASP.NET MVC is “half-backed” or without a strong opinion about how the M should be implemented,...

Stopping the panic: how to improve HtmlHelper.RenderPartial performances. Don’t run in debug mode

There has a been a lot of talking on a possible “big design flaw” in ASP.NET MVC: partial view path resolution was not cached and so a big performance issue. It all started with Rudi Benkovic’s presentation on ASP.NET MVC performances. I also wrote a commentary on his presentation, but I was a bit skeptical about the fact that view path resolution was faster with a full url than with just the name of the view. I said: This last one looks strange to me because the RenderPartial method should be caching the path resolution:...

The performance implications of the expression tree-based ActionLink helper

Earlier today I wrote a post about how to improve the performance of ASP.NET MVC web applications, and I came out with the conclusion that the best way to improve performance is to add data caching and that the rest was not very important. Rudi sent me an email pointing out that turning the optimization upside down as I asked in my post, the expression tree-based ActionLink method still causes a lot of performance problems, at least in his sample application, a DIGG-like application, where there are 4 calls to the ActionLink helper for each of the 20 items...

How to improve the performance of ASP.NET MVC web applications

Today I stumbled upon a nice presentation that Rudi Benkovic gave last week at the Slovenian DotNet User Group, about ASP.NET MVC Performance. The Big Picture It is an in depth analysis of a Digg-like site and how it went from serving (on a test machine) 6 req/sec to 390 req/sec. The biggest gain, 74 req/sec to 390 req/sec happened when he introduced data caching and another 25 req/sec where gained when he introduced the compilation of LINQ queries. Data caching is always the key Splitting the gains among the various components: ...

I’m an ASP Insider

I just learnt that I’ve be invited to join the ASPInsiders. I’m really excited and honored to be part of this group of great ASP.NET experts. Looking forward to help with my feedbacks the ASP.NET team build a better web application framework on the .NET platform, especially in the area of ASP.NET MVC. If don’t know who they are, here is a quick “elevator speech”, taken from the site: “The ASPInsiders is a select group of international professionals who have demonstrated expertise in ASP.NET technologies and who provide valuable, early feedback on related...

13 ASP.NET MVC extensibility points you have to know

One of the main design principles ASP.NET MVC has been designed with is extensibility. Everything (or most of) in the processing pipeline is replaceable so, if you don’t like the conventions (or lack of them) that ASP.NET MVC uses, you can create your own services to support your conventions and inject them into the main pipeline. In this post I’m going to show 13 extensibility points that every ASP.NET MVC developer should know, starting from the beginning of the pipeline and going forward till the rendering of the view. 1. RouteConstraint Usually you could put some constrains on url parameters using regular expressions,...

One little gotcha to remember when upgrading to ASP.NET MVC RTM

Currently I’m in the process of upgrading all the samples I wrote from my Beginning ASP.NET MVC 1.0 book from the Beta to the RTM version of ASP.NET MVC. The biggest update is taking advantage of the views without code-behind. This is not something you have to do on a “real application” since the old way will work also on the RTM, but since my samples are made to show how to develop an ASP.NET MVC application, I hade to upgrade them all to the “correct” way of doing things. The first step is pretty easy: just download the...

Reminder: my talk at DotNetUmbria

Just a quick reminder, tomorrow afternoon I’ll be talking about ASP.NET MVC at the local DotNetUmbria usergroup. Today I spent the whole day putting the finishing touches on tomorrow’s talks and demos. I’ll talk from 3PM to 6PM (or till when people ask for mercy). I’ve two talks planned: Introduction to ASP.NET MVC, my “usual” introductory presentation, update with the RTM bits and yesterday’s big announcement ASP.NET MVC, so what? This was originally planned to be a “live refactoring” of an old WebForm application to ASP.NET MVC, but I changed it...

April’s fool or not? ASP.NET MVC source released under MS-PL

I’m still not convinced completely (the news was announced on April 1st), but seems like ASP.NET MVC source code has been released under MS-PL license, a OSI approved open source license. I’m excited today to announce that we are also releasing the ASP.NET MVC source code under the Microsoft Public License (MS-PL).  MS-PL is an OSI-approved open source license.  The MS-PL contains no platform restrictions and provides broad rights to modify and redistribute the source code. Codeplex license is not updated yet, but at this point I guess ASP.NET MVC deserves a project of its own as the asp.net codeplex project...

ASP.NET MVC for RoR developers: do as locals do

A few days ago, Simon Tokumine, a Ruby On Rails developer from UK who had to build a web app using, as he calls it, .NET MVC (ASP.NET MVC as we usually calls it), wrote a nice post that makes a comparison between RoR and ASP.NET MVC. Actually it was not really a comparison, more a “ASP.NET MVC for RoR developers” kind of post. He was a foreigner that came into the .NET country and visited the city called ASP.NET MVC, and he gave his opinion on his first (or second) visit. But not being a local he only used...

A lap around MIX09 announcements

Many new things came out before the actual keynote, like ASP.NET MVC RTM, Silverlight 3.0 Beta 1 (with Blend for SL3 and its VS2008 tools), RIA DataServices. Not sure if it was something they planned or an error by someone that forgot that 9AM in Las Vegas happens 8 hour after 9AM in Europe, but that’s what we’ve got. The Opening keynote by Buxton I would have never expected such an awesome keynote by Buxton: it was about user experience designer, about UX in MS, about the importance of sketching. Buxton is a researcher, but it was one...

ASP.NET MVC goes RTM before MIX09

Finally, after a two year long cycle that started went public exactly on March 16th 2007, and 3 month later the first planned release date (or maybe Scott’s “end of year” was referring to the end of the second of year of the public development cycle), today before MIX09, ASP.NET MVC goes RTM. Congratulations to Phil, Eilon and all the ASP.NET MVC team for this important milestone. You can download the new bits here. This new release should doesn’t have anything new since RC2, except having updated jQuery to the latest version (1.3.2), and solved a bug...

Suffering from Pre Mix Envy… again

MIX09 is starting in two days, and again, even this year, I’m not going to Vegas: I had to choose between ALT.NET Conf + MVP Summit and MIX09, and I chose for the former. Can’t fly from Italy to US twice in 3 weeks (and I’m still recovering from last flight’s jetlag). But luckily, as they did with last PDC, the keynotes will be streamed live, and all the session recordings will be available almost immediately. I’ll miss the community interactions and I’ll not meet all the awesome guys that will go to Vegas, but at least I won’t...

Wanna see ASP.NET MVC RTM-ed? Help test MVC RC2

Phil Haack just announced that ASP.NET MVC R2 has been released. There are not many changes, and the biggest one is the installation procedure: there is a dependency requirement on .NET 3.5 SP1 (that means you have to have .NET 3.5 SP1 in order for the ASP.NET MVC RC2 to work) there is a “server-only” install mode That’s a big change in the installation tools and, since it’s a new process, it’s the thing that is most likely to break. So, if you want to see...

Ninject.FilterInjector v1.5: now injecting inside all kind of filters

Ninject with ASP.NET MVC series How to use Ninject with ASP.NET MVC How to use Ninject to inject dependencies into ASP.NET MVC ActionFilters Extending Ninject to inject dependencies into Action Filters Ninject.FilterInjector v1.5: now injecting inside all filters The first version of my tiny FilterInjector included only the action invoker for ActionFilters. But ASP.NET MVC has four different filters: Action Filters: executed before and after an Action is executed Result Filters: executed before and after the ActionResult returned by...

Oxite: what’s new and how to stay up to date with it

As probably you read somewhere else, a few days ago the Channel9 team released the latest version of Oxite. If you remember, when it was first released back in December, there was a lot of negative feedbacks, but now it seems like the latest release contains a lot of refactoring. I think I’ll start to play with it. All the team members have a blog (which runs on Oxite, of course) and they posted some blog posts to explain the new changes. Duncan Mackenzie, which is the PM, wrote a post explaining the PR...

Interest in ASP.NET MVC is raising

...Or at least this is what we can infer from Google Trends. From this graph we can see that searches started in 4th quarter of 2007 (when ASP.NET MVC was first announced) and spikes always happened at each release of the various preview versions. The final ramp coincides with the announcement of the RC and the wait for the actual RC release. I wonder what is going to happen when the RTW is released. If you browse to the graph, you'll notice a funny thing: the city that performs most searches...

Extending Ninject to inject dependencies into Action Filters

Ninject with ASP.NET MVC series How to use Ninject with ASP.NET MVC How to use Ninject to inject dependencies into ASP.NET MVC ActionFilters Extending Ninject to inject dependencies into Action Filters Ninject.FilterInjector v1.5: now injecting inside all filters  UPDATE: There is a new version of Ninject.FilterInjector out, version 1.5. You can read more about it on: Ninject.FilterInjector v1.5: now injecting inside all filters  ...

How to use Ninject to inject dependencies into ASP.NET MVC ActionFilters

Ninject with ASP.NET MVC series How to use Ninject with ASP.NET MVC How to use Ninject to inject dependencies into ASP.NET MVC ActionFilters Extending Ninject to inject dependencies into Action Filters Ninject.FilterInjector v1.5: now injecting inside all filters   ActionFilters are a great way to encapsulate pieces of functionalities and move them outside ASP.NET MVC Controllers, but they have a problem: it’s very difficult to inject dependencies...

Look Ma, I’m on the TV (on Channel9)

Last Friday I headed to Microsoft Italy offices in Segrate (with my Vespa and under a pouring rain), for being interviewed by Pietro Brambati, Italian Developer Evangelist, about ASP.NET MVC. You can watch the video (in Italian) on Channel9. I want to thank Pietro and the Italian DPE team for the interview and for the nice tech chat we had during the day. Technorati Tags: aspnetmvc,interview,channel9

How to use Ninject with ASP.NET MVC

Ninject with ASP.NET MVC series How to use Ninject with ASP.NET MVC How to use Ninject to inject dependencies into ASP.NET MVC ActionFilters Extending Ninject to inject dependencies into Action Filters Ninject.FilterInjector v1.5: now injecting inside all filters  By default, the ASP.NET MVC framework instantiate controllers calling their default constructor. This makes using Dependency Injection impossible. But, as almost everything inside that framework, the logic...

Best of 2008: 5 most popular posts

Less than a month ago I reviewed my 2 years of blogging and I listed my top 10 posts ever. Looking back at 2008, I noticed that I blogged a lot about ASP.NET MVC. But looking at the stats probably this is not yet a popular topic, since it’s too early in the product lifecycle: in fact the most popular post of the year is about jQuery. And since my figures are not that high, it’s enough to have a post on the homepage of non .NET social bookmarking site (like reddit) for one day, that the number of views...

Looking at Oxite the “glass half full” way

Today is a sunny (even if damn cold) day in Milano so while I was coming to work I decided I wanted write something good about Oxite, the CMS built by the MIX Online team. The point I want to make is: Oxite is the best example to show how bad WebForms are when it comes to rendering standard compliant HTML. There has been a lot of  negative talking about Oxite: it’s not working out-of-the-box, it’s not such a good example of how to implement something with the ASP.NET MVC framework, people looking at it as state-of-the-art  will...

New Features in ASP.NET 3.5 SP1

ASP.NET 3.5 SP1 has been released a few months ago and everybody (including me) talks only about Entity Framework, Dynamic Data and Routing. But there is more. But Sir Wally came to help and wrote a book (actually a Wrox Blox) about the New Features in ASP.NET 3.5 Service Pack 1, which are more than just EF, DynData and Routing: there are new features also on the Ajax side, ADO.NET Data services and caching. So, what are you waiting for, it's only US $6.99, go and buy yourself a copy of this eBook: New Features in ASP.NET 3.5 Service Pack 1 ASP.NET, Wrox,...

Hot new features coming with ASP.NET MVC RC in January 09

ScottGu just wrote about the new features that are coming with the release candidate of ASP.NET MVC V1 that is going to ship in January. Views without code-behind: all other view engines works that way, and having an additional file just to specify the type of the model is pretty overwhelming. Good for this enhancement. HtmlHelpers now expose the model of the view: this is strictly related to the new feature above. Since you cannot create view-specific helpers anymore, we needed a way to supply the model of the view to HtmlHelpers. ...

Oxite: OpenSource CMS from Microsoft built on ASP.NET MVC

I was on the mountains skiing during this last weekend so I might have missed some big announcement from the .NET blogosphere, but today I found on many “official” IT online magazines (thanks to aspdotnetmvc.com) that the team behind Channel 9 (and 8, 10 and Mix Online) just released on CodePlex the blogging/CMS platform they developed to build Mix Online: Oxite. Oxite is an open source, standards compliant, and highly extensible content management platform that can run anything from blogs to big web sites. We know this because it runs MIX Online. It’s developed with ASP.NET MVC and has been designed...

Giving out 5 copies of Beginning ASP.NET MVC

Tomorrow is the starting day of TechDays-WPC, a conference for developers and IT professionals held every year since more that 10 years, in the Congress Center of Assago, just outside of Milano. I’ll be there, at the Ask The Expert booth, answering questions about ASP.NET MVC, ASP.NET 3.5 and the “ALT.NET stack”. I still don’t know my schedule there: I guess I’ll find it out tomorrow morning when I arrive there. And for all the length of the conference I’ll distribute cards with the cover of our book “Beginning ASP.NET MVC” and with a number on them. The last day of the...

Not even in my worst nightmare

I warn you, send your child to bed before reading this code snippet: <span id="lblUser Birthday">User Birthday</span><br> <input type="text" name="txtUser Birthday" ID="txtUser Birthday"> OK, the HTML4 DTD allows spaces inside the NAME attribute (it’s a CDATA) but it’s one of the worst practices I ever saw (even the control’s name autogenerated by ASP.NET web forms uses $ to separate names’ parts). And spaces are not allowed inside the ID attribute. Pragmatists would say that IE and Firefox are pretty tolerant and eat up everything, but this is pretty scary anyway. I didn’t dare to ask “Who wrote this code?!” Technorati Tags: nightmare,html,error

Configurable indentation for NHaml

NHaml, an alternative view engine for ASP.NET MVC written by Andrew Peters, uses indentation instead of opening and closing tags to identify code blocks. If you never saw something written in NHaml here is taste of it. If you want to loop over a list and put it inside a unordered list with webform you would write: <div class="list"> <ul> <%foreach (var route in ViewData.Model) { %> <li><%= route.Name %></li> <% } %> </ul> </div> The same...

How to call controllers in external assemblies in an ASP.NET MVC application

If your ASP.NET MVC is growing large, it’s likely that you are partitioning your controllers in different namespaces, or maybe even in different assemblies, and it might happen that you have controllers with the same in different namespaces. Phil Haack and Steve Sanderson wrote some great write-ups on how to partition an ASP.NET application down into Areas, a concept that exists in MonoRail but not in the core ASP.NET MVC framework. The two posts above allow grouping both the controllers and the views, so if you want a complete solution to the aforementioned problem make sure you read them. What I want...

SEO starting guide for ASP.NET

Today I just found two great sources of information on Search Engine Optimization. Google’s search engine starter guide The first has been released directly by Google: Search Engine Optimization Starter Guide It covers the most common areas that might need a bit of optimization: urls, titles, metatags, image’s alt attributes, robots.txt file and other topics. A must read for everybody that is interested in the topic. SEO for ASP.NET podcast The second resource is the great (as always) podcast by Polymorphic Podcast about SEO for ASP.NET. The guest, Michael Neel, talks about which are the main points of Search Engine Optimization, especially with ASP.NET. And the main...

The Thunderdome Principle and a very opinionated MVC stack

Last week Jeremy Miller introduced their own opinionated MVC stack built on top of the MS ASP.NET MVC framework. They talked about this at the KaizenConf that was held last weekend in Austin and as it happened for all the PDC sessions, here are the videos of their “Using and Abusing ASP.NET MVC for Fun and Profit” session. It’s available in two parts: Part 1 and Part 2. Technorati Tags: aspnetmvc,KaizenConf

PDC 2008 Videos I’m watching – part 3

That’s the latest “episode” of my review of the PDC videos I’m downloading and plan to watch in the future. I’m now at 8Gb of videos. For those who are interested, on Channel9 the same video are available also in lower quality WMV, formatted for the Zune and in MP4 for those who want to watch on a iPhone or iPod. .NET: PC49 - Microsoft .NET Framework: CLR Futures - Ian Carmichael, Joshua Goodman ASP.NET: ...

PDC 2008 video I’m watching

I’m not at PDC 2008, so I’ve to keep up with what’s being announced in LA only through videos. I watched the two keynotes live (for those who missed them, they are available on demand from the homepage of PDC site). But there are many other interesting videos to watch. Here is a list of the ones I’m downloading and I’m planning to watch over the next days (well, probably nights): ASP.NET and Web Development PC20 - ASP.NET 4.0 Roadmap - Scott...

Talking about ASP.NET MVC in Apulia

Another weekend, another community event: last Friday/Saturday I was at the Italian MVP OpenDays in Milano and next Friday (October 24th) I’ll be talking in front of more than 70 person (the event is sold out) at the “ASP.NET 3.5 and beyond Web Development” workshop organized by DotNetSide, the .NET usergroup of South Italy. I’ll speak for 3 hours (and probably more) about ASP.NET MVC and the new features that the .NET 3.5 SP1 brings to the table. There will be 2 sessions: Life after SP1: I’ll talk about Dynamic Data, Routing, the new...

How to solve the “Visual Studio vanishing” bug of ASP.NET MVC P5

The latest release of ASP.NET MVC had a weird bug: with Visual Studio 2008 SP1, when you open any view page, Visual Studio just vanishes, with no error dialog displayed. The Application log contains an item with the following error message: .NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (6AFD0F92) (0) With a bit of trial and error, and thanks to some other posts and comments I found out that the reason for this is some conflict with the Visual Studio PowerCommands tool: uninstalling it fixes the problem. In my previous installation,...

Big in Bosnia

Well, not as the Guano Apes in Big in Japan, but, tonight our (Keyvan’s and mine) book, Beginning ASP.NET MVC, went for the first official public display at a INETA user group meeting in Banjaluka, Bosnia, during a presentation about ASP.NET MVC held by Dragan Panjkov. Thanks to Dragan for the plug and for the photo. UPDATE: More info about the talk, together with slides, demos and more pictures of the event can be found on Talk: Introduction to ASP.NET MVC. Technorati Tags: aspnetmvc,Banjaluka,book

ASP.NET MVC Beta1 in a few weeks and v1 by end of year

A tweet in the morning, straight from Remix08 UK, where ScottGu is doing a presentation on ASP.NET MVC: ScottGu says feature complete MVC beta "in a few weeks". final v1 by end of year Then the month that ends in ember is December, not March-ember as someone said. [via irascian and Andrew Rimmer] Technorati Tags: aspnetmvc,remix

ASP.NET MVC Preview5 released

Keeping on with the 6 weeks release plan, the ASP.NET MVC team quietly release P5 of ASP.NET MVC on Codeplex. Some changes happened: the IViewEngine now is responsible of finding the view, not rendering them any more The Ajax Helper class has been moved to its own namespace to enable easier replacing of Ajax client library Added a ModelBinder to bind complex custom type as action parameters Added the AcceptVerbs and ActionName attibute to be able to use actions with the same name...

No GoLive required to use ASP.NET MVC in production

I might be the only that missed that, but today a discussion on the internal Avanade mailing list brought to my attention an interesting fact: the ASP.NET MVC framework is not as all other Microsoft pre-release software that need a GoLive license (like it was for Silverlight or Atlas) but you can legally use in production code. On the mailing list they pointed out a comment on ScottGu’s blog: >>>>>>>>> 2. For which MVC drop we will have GoLive licence? I'd like to use it for my next project, and this fact will decide what...

Look Ma, I'm on a book cover

Well, not yet, but hopefully soon. Which book cover am I talking about? It’s book I’m writing together with Keyvan, about ASP.NET MVC, for Wrox. The book title will be “Beginning ASP.NET MVC”. You way wonder why a book about a technology that is not even in beta and about which there are already six books. The reason is simple: all the six books are “pro” books, targeted at experienced developers, that are already trying out the early bits, but that want to know more. We both are writing two introductory series on ASP.NET MVC on two famous .NET...

Learn ASP.NET MVC from the guys that made it

A new book about ASP.NET MVC is coming: Professional ASP.NET 3.5 MVC. And is written by the guys that are developing it: Rob Conery, Scott Hanselman and Phil Haack. [via keyvan on twitter] Amazon says it will be released on October 20th, so I guess that by that date we will have the RTW version of ASP.NET MVC. Or maybe they are hiding the truth. ASP.NET, aspnetmvc, book

ASP.NET MVC Preview 4 links collection

It always started with a tweet from Scott Hanselman yesterday evening: “ASP.NET MVC Preview 4 http://www.codeplex.com/aspnet”. The ASP.NET MVC interim version has been released as source code + MSI with project template + release notes 7 weeks after the last official release of the P3. Lots of people already wrote about the new features so I’d rather read what they already wrote then rewriting it myself. Here is the list of the posts/documents I printed and that I’ll be reading today: ASP.NET Codeplex Preview 4 Readme (PDF) and Changes between Preview 3 and...

Comparing the backgrounds of web developers

Web developers on ASP.NET have (mostly) a client or client-server background. Web developers on Java have (mostly) a client-server background or a web background. PHP and Ruby and Pyton (and so on) ones have only web development background or even web design background. This is just a quick idea that came to my mind this evening while running, and I wanted to share... I think I'll elaborate more on this in a following post. PS: I know, there are exceptions to these statements (as I am, since I was born as web developer and I develop on ASP.NET), but for the majority of developers...

ASP.NET MVC content aggregator

A few days ago, looking at the referrers to my blog, I found a reference to site I never see before: aspdotnetmvc.com. It’s a really nice content aggregator that collects anything related to ASP.NET MVC, gathering it automatically from various sources. It already helped me discover a few ASP.NET MVC related blogs I was not following. Technorati Tags: aspnetmvc,blogs

Yet another presentation on ASP.NET MVC at DotNetMarche

On Friday I’m delivering my third presentation on ASP.NET MVC in less than one month (actually the 4th because I repeated twice the one I delivered inside Avanade). This time it will be inside the 6th DotNetMarche Workshop on “Applications’ automated testing and ASP.NET MVC”. You can have a look at the agenda of the event (translated by Google). I’ll try and make everything available online after the event, especially the code samples. Technorati Tags: aspnetmvc,event,dotnetmarche

How to manage ASP.NET validation from Javascript with jQuery

Validators are a great part of the ASP.NET framework: they provide a standardized and easy way to add validation to form fields. But even if the framework provides different kinds of validators, there are so many different validations patterns that sometimes you have to write custom code to match your specific requirements. I wrote a post a few months ago about how to write a custom validator for a Checkbox list, but I was dealing with a completely new validation pattern. But what if I only want to enable the validation of certain field based on certain conditions? Or...

ASP.NET 3.5 + VS2008 SP1 beta

Probably you already read this announcement somewhere else in the net, so I'll not replicate the news here. What excites me the most are mainly two things: Part of the ASP.NET MVC framework are going to be included into the core ASP.NET framework: System.Web.Routing will be included in ASP.NET with the SP1, so around this summer, probably well before ASP.NET MVC is RTW Intellisense will work for Javascript files, and will have support for jQuery, Prototype and other popular JS library out of the box. You can read more about the other improvements on ScottGu blog...

Where I'm going to talk this Spring

This year it's going to be a busy spring for me: April 26th/27th: Loci - Evoluzione generativa: Aurora - an art exhibition where there I presented a short video I made with Processing (on Vimeo 2 drafts of the final video) - Porto Sant'Elpidio End of May: Introduction to ASP.NET MVC - This is a private 2h workshop I'll deliver for my colleagues at Avanade Italy - online June 14th: UGIALT.NET conference - The second conference of the the Italian ALT.NET group. Actually not a real talk, but an OpenSpace meeting......

Testing ASP.NET MVC on DotNetSlackers

My second article on the ASP.NET MVC is now live on DotNetSlackers. This time the article is about how to test ASP.NET MVC web applications: unit testing, how the ASP.NET MVC framework facilitates testing and how to test Controllers, both with mocking and with the Extract and Overide Call method. Check it out here: ASP.NET MVC Framework – Part 2: Testing Any comment is welcome. If you missed the first article, with a introduction to the ASP.NET MVC framework you can read it here: ASP.NET MVC Framework – Part 1. Technorati Tag: aspnetmvc,unit test,article,dotnetslackers

Videos on ASP.NET MVC from ScottHa

I just spent the last 3 hours watching all the latest videos available on the ASP.NET MVC MIX08 Preview Release: Part 1 - Displaying Data Part 2 - Editing Data and Making Forms Part 3 - Advanced Techniques Part 4 - Testing Developing ASP.NET Applications Using the Model View Controller Pattern, session from MIX08 If you haven't done yet, I recommend you to watch them all, especially the last one, which is summing up of all the first 4 screencasts, but enhanced with some technical and...

Let's tag all ASP.NET MVC contents with aspnetmvc

One thing that is wrong with the ASP.NET MVC framework is the name: ASP.NET MVC Framework is too long, it's composed by 4 words, and so not easily usable as "tag". Usually social sites have problems when dealing with multi-word tags: some split them in more tags: ASP.NET MVC becomes ASP.NET and MVC other needs you to enter them with a + between the words: ASP.NET+MVC yet another behavior is using the underscore: ASP.NET_MVC Given all these different behaviors people tag posts, articles and whatever else related to that topic with many...

Testing ASP.NET MVC P2

I'm playing a bit around with the ASP.NET MVC "MIX08 preview" and I wanted to use a different approach to testing the RedirectToAction method. SubText fellow Phil Haack wrote some sample tests back in December with the previous preview version of aspnetmvc, but I wanted to play around a bit so I wrote my own version. [TestMethod]public void AboutOverride(){ HomeControllerForTest controller = new HomeControllerForTest(); controller.About(); Assert.AreEqual("Index", controller.SelectedViewName, ...

The links from MIX08 already available: MVC 2 and Silverlight 2.0

I'm watching MIX keynote online, but for curiosity I browsed the MS download site, and I found those 2 interesting links: ASP.NET MVC Preview 2 Microsoft Silverlight Tools Beta 1 for Visual Studio 2008 - with Silverlight 2.0 beta 1 runtime and tools Technorati Tag: mix08,Silverlight 2.0,aspnetmvc

ASP.NET MVC in Action by Jeffrey Palermo

Yesterday I noticed on Jeffrey's blog that the book he is writing on the ASP.NET MVC framework is available now as Early Access Program. At the moment the first 4 chapters (first as in first to be written, not first as in the order of the chapters) are available for download (not free, you have to pay for the Early Access, but you will get the book as well, once it is published): Chapter 1 - Getting Started: a nice introduction on the MVC framework (this chapter is free for everyone) ...

Italian ALT.NET miniconf: small in size, high in value

Yesterday I went to the first conference of the recent born UGIALT.net usergroup. It was my first time at a OpenSpace conference and I really like it. We talked about ASP.NET MVC, about UnitTesting, TDD, Mocks, and also about code metrics with NDepend and SourceMonitor. I was the moderator of the session on the ASP.NET MVC framework, and was nice to see all the other bringing to the table their experiences, especially Gianluca that, for each feature of the ASP.NET MVC, made a comparison with MonoRail. We noticed that ASP.NET MVC lacks of a feature that might be interesting: the possibility to...

I'm a (DotNet)Slacker on the ASP.NET MVC Framework

Today my first article on DotNetSlackers just got published. It's an introduction to the ASP.NET MVC framework that was released as part of the ASP.NET 3.5 Extensions Preview: it contains an overview of the MVC pattern and how it is implemented inside the ASP.NET framework. Check it out: ASP.NET MVC Framework – Part 1. The second part is already in the works, and it will be about testability. Technorati Tag: aspnetmvc,asp.net,article,mvc

ASP.NET MVC Link collection

Together with playing around with Silverlight, lately I started to have a look at the MVC framework that the ASP.NET released as part of ASP.NET 3.5 extensions. Here is a list of some of the best links I found on the topic: Downloadable content from ScottHa blog: ScottGu MVC Presentation and ScottHa Screencast from ALT.NET Conference - the first presentation ever on the MVC framework ASP.NET 3.5 Extensions - plus MVC How-To Screencast - How-to Screencast on the...

.NET Ajax Survey results

A few days ago Ajaxian published the results of a survey about the usage of Ajax among web developers, but since it was too generic for my taste I decided to make one targeted only to .NET developers.I got a bit more than 1000 responses in less that 2 days, and since the results were starting to stabilize (and the response rate was very low compared to the 50 responses per hour of the first day), this morning I decided to close the survey and then analyze the data and publish the results. The results But let's have...

Ajax usage among .NET developers

UPDATE: The survey is closed and I just published the results of the survey: .NET Ajax Survey results. Given the results of Ajaxian's survey about the state of the usage in the web development community, I decided to make a new survey, but this time only focused on .NET developers. Please click here to take the survey. I'll collect the results and then make some more stats. The questions are the same as the Ajaxian's one: Are you using Ajax in production, development, proof of concept or not using it at all?...

ASP.NET Ajax usage floats around 35%

UPDATE: I setup a survey focused only on .NET development here. Ajaxian, blog focused on everything related to Ajax development and JS libraries, last week announced a survey about the state of Ajax usage among developers and in the enterprise. The questions were simple: Are you currently using Ajax? Which programming language/web framework are you using Ajax in conjunction with? Which Ajax toolkit, framework or JS library are you using? Yesterday they published the results of the survey, which has been answered by 2618...

How to install ASP.NET 3.5 Extensions Preview

If you are like me, and don't read the instructions and the readme files, you might encounter a few problems in getting the ADO.NET designer to work. To enable the ADO.NET designer you need to install the ADO.NET EF Tools. But in order to install it correctly you have to install also the ADO.NET EF beta 3 and a cryptic XML Editor QFE in the right order. So the correct installation order is: Visual Studio 2008 XML Editor QFE ADO.NET EF Beta 3 ADO.NET EF Tools (Dec...

UseHttpGet needs you to enable HttpGet in the web.config

If you want to access a web service from an ASP.NET Ajax page or from a Silverlight 2.0 app, you have to decorate it with the ScriptService attribute. This will enable the creation of a JavaScript proxy to call the web service using the JSON notation. The generated proxy will call the web service using the HTTP POST method. But what if you want to use the GET method? There is another attribute that you can specify to fine tune the response of a single method: ScriptMethod. Among the possible tuning, you can specify that you want to use GET...

ListView breaking change strikes the VS2008 Training Kit

The same day VS2008 was released, Microsoft released also a training kit with 120Mb of PPT, demos and code samples. Among the many demos there is one about the new features of ASP.NET introduced with the framework 3.5: LinqDataSource, DataPager, and ListView. But the code for the sample on the ListView contains an error, probably because it was developed with the beta2, and it happens that the RTM has a breaking change on this. With Beta2 you could do (warning, this won't work with VS2008 RTM): <asp:ListView ID="ListView1"...

Hammett on ASP.NET MVC

Hammett, founder of Castle, the father of MonoRail, went to Redmond invited by the ASP.NET MVC team, to review the new framework, and give his opinion based on his experience having built a similar framework. You can have a look at the blog post where he wrote his opinions, but I'd like to quote here the ones I feel are the most impressive: [...] surprisingly - at least to me - is how MS is approaching this framework. They are not in a rush, they are more concerned about getting it right than getting it done fast. My overall impression is that...

ASP.NET MVC

This afternoon, while I was installing for the 4th time this year the Service Pack 1 for Visual Studio 2005, I printed the first post by ScottGu about the new ASP.NET MVC framework. It's a long article (28 printed pages excluding comments) that details quite well the process behind the development of a simple website using all the default behaviors of the framework. I just want to highlight a sentence I really liked: You can use any unit testing framework (including NUnit, MBUnit, MSTest, XUnit, and others) with the ASP.NET MVC Framework. We'll also be shipping project template downloads for NUnit, MBUnit and other...

Yet another ALT.net opinion

I wanted to write my opinion about the ALT.net thing since a long time, but I really never find the time to sit down and organize my ideas into an organic post.The event that "triggered" this post is my friend Lorenzo asking my opinion about his blog post "There are architect and Architects" (it's in Italian but here is the link to the auto-translated version by Google). In his post Lorenzo, commenting on Sam's post about leaving CodeBetter and ALT.NET, adds some thoughts about something that usually the hard-core ALT.NET people don't get: imagine you have an Enterprise-level project,...

More details on the MVC for ASP.NET

I just watched the videos published by ScottHa with the presentation by ScottGu on the new MVC framework for ASP.NET, and really liked the approach the MS team that is going to be lead by Phil is having on this: everything is pluggable, everything is replaceable, no more postbacks, no more viewstate. To view the video yourself, if you are not among the 20k subscribers of Scott Hanselman blog, go to his post and follow the links to watch the videos in Silverlight format. Or download the WMV files: ScottGu on MVC at ALT.NET Conference ...

MVC framework for ASP.NET

Phil Haack already semi-announced it when he said he was going to work for Microsoft and would be the Program manager for the new MVC framework for ASP.NET that Microsoft was planning to build. Today at the ALT.NET conference, Scott Guthrie officially announced it. The main goals of the MVC for ASP.NET are: Natively support TDD model for controllers. Provide ASPX (without viewstate or postbacks) as a view engine Provide a hook for other view engines from MonoRail, etc. Support IoC containers for controller creation...

LinkLift control for ASP.NET revised

A few months ago I released a rough first version of an ASP.NET control to display text-links served by LinkLift. Since then the control became the "de-facto" official control for ASP.NET (Italian, German, French and Spanish). Today I found quite a subtle bug that never showed up before (since I never really had the control on my site for more than a few hour): I used the FileSystemInfo.CreationTime to keep track of the last time the local copy of the XML was saved. But the CreationTime is the first time the file was saved, because all the subsequent saves are...

YUI JS Compressor becomes YUI Compressor: now with CSS compression

Julien Lecomte is riding the wave of his YUI JavaScript Compressor and has just released the version 2.0 of the YUI Compressor. This version includes Isaac Schlueter’s regular expression based CSS minifier. Therefore now the YUI compressor can minify both JavaScript and CSS files. Minifying CSS will not help me improve my YSlow score again, but will save a few KBytes per request. Technorati tags: YUI Compressor, CSS, Minification

YSlow performance challenge: improved from 36 to 64

Mads Kristensen, after reading my report about the score given by YSlow to his and other blogs, improved his score and challenged me to do the same. After 20 days, recovering from the time zone shift, and after a few days of holidays, yesterday evening I finally managed to try and improve my score: with some manual tuning to the CSS, the JavaScript files and Subtext masterpage I improved my score by 77% (28 points, from 36 to 64). I didn't beat Mads's score which is 67 (was 71 at the time of the challenge), but his improvement was 15 points, which is almost...

YUI JavaScript compressor

Following the release of YSlow, there has a lot buzz around the rules it evaluates. And even if not all the 13 rules are issues for normal websites, some of them, like gzipping all the static text files (CSS and JS) and minifying JavaScript are good advices also for websites with not so many users as Yahoo!. At Yahoo! they suggested to use JSMin, a tool developed by Douglas Crockford, a guy working for Yahoo!. JSMin is only a minifier: it removes comments, unnecessary whitespace and linefeeds but does not change the name of variables or functions to shorter identifiers...

Dissecting YSlow

In the last weeks there has been a lot of talking around YSlow, the tool that the Yahoo! Developer Network released to check sites against their 13 rules of High Performance Web Sites. Last week I used it against various blogs and I found out that my blog is rated only 36/100. So, also after the challenge started by Mads, I decided to try and improve my score. The final score is a weighted average between the scores for each of the 13 rules. This means that some rules are more important than others and to increase the score of a site...

How to debug XmlHttpRequest with Firebug

I've been using Firebug since a few months and I really love it: it allows you to inspect the HTML, to look at the CSS applied to an element and where each single attribute has been set, to visualize the box around each element, to debug JS, to view the JS stack trace, to change the CSS directly on the page. If you never used it, I really suggest having a look. A must in the web developer toolbox. But today I found another interesting feature, that is not well advertised on the Firebug website: XmlHttpRequest debugging. To enable it just open the...

How to add a required validator to a CheckBoxList

If you add a normal RequiredFieldValidator and you want to validate a CheckBoxList, you will get a runtime exception informing you that the CheckBoxList cannot be validated. Sometimes you want to make sure the that user has selected at least one of the checkbox in the checkbox list, but as aforementioned, if you user a normal RequiredFieldValidator you will get an exception. You could use a CustomValidator control, but a nicer and more reusable approach is to build a custom web control that extends the BaseValidator. I found a 2001 article on how to do that (Building a CheckBoxList Validator Control) but...

How NOT to prevent SQL Injection

This is the best anti-pattern about security and SQL Injection on the web. Today I found, via <edit>, html.it blog, a CMS that use a "creative" approach to get data from the DB: passing the SQL string directly as querystring to the page. Here is an example: newssearch.asp?strSQL=SELECT+*+FROM+news+WHERE+(+lingua+%3D+'ENG') And if you search on Google for "allinurl:sql select from where", you will find heaps of pages that use this approach (tonight the results were 111.000). I found sites built in ASP Classic, PHP, cgi, Perl, seems quite a widespread technique. What if someone writes DROP TABLE NEWS instead of SELECT ...? Technorati tags: sql injection, security

LinkLift Control: here is the code

Last weekend I released a small ASP.NET User Control to display the Text Links provided by LinkLift. I also promised that I would have released the code for it. This weekend, among other things, I cleaned it up a bit, I fixed a small bug and here it is: Download the source of the  LinkLift ASP.NET control. I also set up a project on Google Code to store all my opensource projects that are too small to have their own repository, and I called it, ala Ayende, CodeClimber.Commons. And will move all my personal code on it soon. Technorati tags: linklift,...

How to clean your ASP.NET HTML markup with the CSS Adapter Toolkit

The HTML rendered by some built-in ASP.NET controls is ... ugly: lots of tables, nested tables, useless divs and spans, and sometimes even not compliant with accessibility guidelines for public sites. What is the CSS Adapter ASP.NET 2.0 has the Adaptive Control Adapter Architecture that allows developers to override the default rendering of the built-in controls for some specific browser (for example mobile devices or set-top box). Leveraging this feature, the ASP.NET team released the CSS Adapter Toolkit, which was initially intended as example to show how to develop a control adapter, but then became the de-facto implementation to render some built-in ASP.NET...

Ajax TreeView

For the project I'm working on I have to display thousands of user grouped by team, company, accounts, resellers and, sometimes, reseller of resellers. And I need to display the hierarchy using a treeview. Unfortunately the treeview control that is available with ASP.NET 2.0 cannot handle so many "nodes" with a decent level of performance, and even if he could, an html page with some thousands of users added inside nested <ul> tags will probably be more than 1 or 2 Mb: not something you want for your web application. Unfortunately the is no TreeView control inside the ASP.NET AJAX Control Toolkit,...

How to refresh an UpdatePanel from javascript

I thought that updating an UpdatePanel from javascript was one of the most frequently asked question about ASP.NET Ajax, but even looking around a lot I didn't find a clean and polished solution for what should be a common task. I didn't want to create an ASP.NET Ajax extender for such a simple task, but after a few hours of Google-ing, I found a few nice articles on Ben Rush's blog, which is a very valuable source of knowledge on the internals of ASP.NET Ajax, ScriptManager and other ASP.NET Ajax goodies. Programmatically or Manually refreshing an UpdatePanel...

Remember to set UpdatePanel's UpdateMode to Conditional

Since the cool thing about the ASP.NET Ajax UpdatePanel is that its contents are updated asynchronously when an event that would normally generate a postback is raised inside, one would think that this is its default behavior. But it's not: the UpdateMode property of the UpdatePanel has 2 possible values: Always Conditional and the default value is Always. When set to Always, the UpdatePanel is updated on every postback raised from anywhere in the page, so from controls inside the panel, inside other panels or just on the page. When set to Conditional, the UpdatePanel will be updated only on...

How to make a Gmail-like loading indicator with ASP.NET Ajax

At the moment I'm working on making a web application we just developed more user friendly and more appealing to the end users. The application uses a few ASP.NET Ajax controls so I was pretty surprised when the customer sent me an email saying that he liked all the dynamic loading and the fact that he could reorder "things" using drag&drop and saving them without waiting the page to reload, but it took him a while to understand was going on. The first time he clicked the button, and since nothing happened, he thought that something was going wrong, so he kept...

Ready to MIX?

Today is MIX07 start day: if you are like me, and you are not lucky enough to live in the US (or to have your company pay for you the trip to Las Vegas) here is the visit MIX from Home blog. It should be a continuously updated report of what is going at the MIX. What are they going to announce at MIX? Here are some speculations: Expression Blend Express, Zune phone, Office and Visual Studio will be in .NET A dynamic language runtime, Silverlight for Linux, Silverlight with a micro-CLR ...

WPF/E has name: Silverlight

Sunday 15th was NAB day, and everybody was waiting for some shocking announcement from Apple (which announced only a professional version of Final Cut Server), but the shocking announcement came from the other side of the wall. Microsoft announced its "flash-killer" web platform: MS Silverlight. I've always been a fan of advanced GUI for the web, and finally we have a flash-like platform that can be developed with Visual Studio and developer oriented IDE. Flash was good but it lacked a powerful IDE as Visual Studio. Here are some link to blog of people directly involved in the development: ...

Beware the ASP.NET SetCacheability method

A few months ago, while still working on websites with millions of users per day, Luigi and I spent a bad evening trying to debug the cause of a sudden increase in the CPU time of our live servers. In ASP.NET you can choose whether a page is cached by the browser or not simply setting the Cache-Control HTTP header with that code: Response.Cache.SetCacheability(HttpCacheability.NoCache) The SetCachability method: Sets the Cache-Control HTTP header. The Cache-Control HTTP header controls how documents are to be cached on the network. Going back to problem I had, I had just added a page with the live results of the match, so I set...

DataFormatString is not applied to BoundField

<asp:BoundField DataField="data"      HeaderText="Data" SortExpression="data"     DataFormatString="{0:d}" /> Why does this line of code (ehm... markup) always render the string "27/03/2007 0.00.00" as if it was just using a normal ToString(), instead of "27/03/2007", which is the result of the String.Format method using {0:d} (ShortDate format)? At first I was thinking about some kind of error in the format string, but after carefully reading my format string bible I decided it was not my fault: a few search on Google and I found out this interesting post about some breaking changes in the ASP.NET 2.0 GridView. The ASP.NET team decided to HtmlEncode by default all...

ASP.NET 2.0 new features documentation roundup

I just had to collect a list of links about the new features of ASP.NET 2.0 for my colleagues since our next project will be ASP.NET 2.0 and will leverage almost all of that features, so I think is worth sharing it. Membership/role/profile API: for managing account, login, administrative permissions, and so on (and you can build a custom provider that gets data from a legacy database) Using the Membership and Role Manager API: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/security/membership.aspx Introduction to Membership: http://msdn2.microsoft.com/en-us/library/yh26yfzy.aspx Implementing a Membership Provider: http://msdn2.microsoft.com/en-us/library/f1kyba5e.aspx SiteMap: bound with the feature above, will make very easy the process of limiting...

Going dinner with NET 3.0

The Microsoft Platform Evangelism team released a very nice technology demo product to show all the new cool technologies Microsoft just released or is going to release during that year. The demo utilizes several technologies including: IIS7, ASP.NET Ajax Extensions, Linq, Windows Communication Foundation, Windows Workflow Foundation, Windows Presentation Foundation, Windows Powershell, and the .NET Compact Framework. They are developing the demo on CodePlex, so you can download the code directly from there. The also build a web site DinnerNow.net, that will contain a working demo, and will host videos showing the features of the "product". At the moment...

ASP.NET AJAX 1.0 released!!

It's official, ASP.NET AJAX (formerly known as ATLAS) has just been released. Everybody is speaking about it: ScottGu, Nikhil Kothari. Here are the official download link, the link to the docs (with video tutorials, too), and, for readers that still don't know what ASP.NET AJAX is, there is also an "About" page. Also, the ASP.NET Podcast by Wally produced a lot of nice shows about ASP.NET Ajax and its Control Toolkit, both audio only and video. A funny thing is that the main blog about AJAX, ajaxan, doesn't say a word about it. UPDATE: A few hours later this post, also...

DotNetNuke drops support for .NET 1.1

Just before Christmas a new version of DotNetNuke has been released. 4.4.0 is the new version number and, unlikely the previous releases, it is not accompanied by a 3.4.0 version: this means that there won't be any more .NET 1.1 compatible DNN release. And, IMHO, who needs new 1.1 compatible releases? The 4.4 has many new features, mainly concerning performance and scalability improvements. Here is the the release announcement. To have a better understanding of which are the new performance improvements I recommend reading the posts that Shaun Walker wrote almost a month ago: Windows Hosting Performance & Scalability Performance Enhancements One...

ASP.NET AJAX RC is out

Just released ATLAS ASP.NET AJAX RC. This brings all the ASP.NET development community One Step Closer to the official release. Since I just quit my job, and I'll be flying to Wellington on Jan 2nd,  I could have some spare time next week to download it and make some experiments. And, maybe, we can even start thinking about migrating the ajax stuff inside Subtext from Magic Ajax to ASP.NET Ajax.