ASP.NET v2.0: Posting to Other Pages is too Limited
I'm definitely excited about ASP.NET v2.0 and all the new features it brings, so its hard to criticize it in most cases. However, one problem I have is with the current implementation of posting to other pages. As most ASP.NET developers know, your server-form is limited to posting back to itself in ASP.NET v1.*. This behavior will change in ASP.NET v2.0 with a feature called cross-page posting. Basically, each button (and other relevant controls) have a postTargetUrl property. This property allows you to specify where that control will cause the page to be posted to. This is great in most cases since it allows the post target to be changed on a case-by-case basis, while keeping the rest of the form to still post back to itself. The problem is that the current implementation forces this url to be a page in the same application!
I understand what the ASP.NET team is doing -- they are allowing you to actually code against the original page from the new page that was posted to. This is a great feature, but there is little need for posting to another page of your own application! On the other hand, there are very real and important needs to be able to post to other pages outside of your server, let alone your application. These include all sorts of services that others have implemented, including some payment processing engines. There are work-arounds to this right now in v1.* that will continue to work in v2.0, but I think they should address the real need here if they are going to address it at all. In case you are wondering, the work-arounds are to (1) use non-server forms and no server controls, (2) emit client-side java-script to change the action attribute of the form, (3) or use a custom server form control like Andy Smith's from MetaBuilders or my WilsonWebForm.
I don't expect them to change their overall approach and start allowing multiple server forms, which so far can only be done with my WilsonWebForm. I don't like that they limit valid html which makes perfect sense in some cases just because its not the best practice in most cases, but I do appreciate their stance on this -- and it certainly helps me sell more subscriptions. But this is different, they are going out of their way to admit there are cases that require something different, while still ruling out the only scenarios that really matter. And so far it seems that this feature is getting received very well (although I doubt this huge limitation is understood by most of these people), so its actually kind of funny to me that they originally didn't even want to provide this feature at all when I and others first asked for it. So write to Rob Howard or Scott Guthrie and complain now while there is still time to correct this oversight.