Misc. Coding

ASP.NET 4.0

When we were adding WebForm routing to ASP.NET 4 Beta 1, we didn't have a chance to add in a couple of methods which make working with Routes and Web Forms a lot easier! Note: the code below is 'similar' to that which we're adding ASP.NET 4 Beta 2, *that* code will be of much higher quality however, this is a sample only! 1: using System;
2: using System.Collections.Generic;
3: using System.Linq;
...

AdapterGroups are in Beta 1 but will (likely) not be in Beta 2 of ASP.NET 4.0 This week I have the job of removing a feature which I originally designed for ASP.NET 4.0. This feature is 'AdapterGroups', so what is it? As you may be aware ASP.NET has a capability which allows switching how a control is rendered based on the capabilities of the browser the user makes the request for an ASPX page using. One of the ways this using a feature called Control Adapters. Even though these were originally designed to support mobile browsers, one of...

TechDays MVC 4.0 OverviewÂ Â Â Â Â Â TechDays MVC Presentation Well, I've been back in the US for 5 days now, still really jet lagged but getting there; also managed to pick up a stomach bug at some point...Yes, I'mÂ a hypochondriac! The three weeks I spend travelling round Europe were really fun, I got to head home and see family for a couple of days as well as spend time in Helsinki, Finland, Antwerp, Belgium and Vasteras, Sweden. The picture below is Peli de Halleux and myself standing on the frozen Baltic Sea...which a few minutes...

One of the smaller additions we've made to ASP.NET 4.0 WebForms is the addition of two properties on the Page class, Page.MetaKeywords and Page.MetaDescription. What these two properties do is provide access to / create meta tags within yourÂ page as follows: <head runat="server"> Â Â Â <title>Untitled Page</title> Â Â Â <meta name="keywords" content="These, are, my, keywords' /> Â Â Â <meta name="description" content="This is the description of my page" /> </head> Simple, right? In fact these two properties work the same way as...

ViewState is a pain...there, I've said it! What causes the most pain with ViewState is the fact that people misuse it a lot, leaving it enabled for every control inÂ a page when in fact you only really need it for that one control which really needs to persist it's contents to the next page. Dave Reed a developer on the ASP.NET team has written a truly epic post on 'Truly Understanding ViewState', and before you read what comes next, you really should head off and read that first... Back? Ok, well now you understand...

ASP.NET determines the capabilities of the browser with which a user is browsing your site using a feature called 'browser capabilities'. In ASP.NET 3.5 SP1 there are two main ways in which you can define the capabilities which a browser has:
1. To make the change for your entire machine. Go into C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers, find the browser you want to alter, find the specific capability you want to alter in the XML, change it then run aspnet_regbrowsers.exe -I from the VS Tools command line to rebuild the Browser Capabilities assembly and add it to the GAC...
2. To make a change for just...

Â NOTE: This is a quick introduction,. I'll drill into this more in a future post. One of the things we're adding in ASP.NET 4.0 is built-in support for using Routing together with WebForms. Now, I'm totally aware that this is possible to do already and that a number of people have posted ways of doing this with the Web Routing feature which shipped with ASP.NET 3.5 SP1. We're just adding some features to make it easier to do... So, what are we adding? WebFormRouteHandler, this is a...

Of of the ASP.NET enhancements which first made an appearance in the Visual Studio 2010 PDC CTP releaseÂ is the ability to set a client Id which you can be confident will be used when the control renders it's markup. All of the samples in this post will use the following Server Control: using System.Web.UI; using System.Web.UI.WebControls; namespace TestControls ...