I was looking around today for the best way to get default button behavior in ASP.NET 2.0, I was just about to use my favorite 1.1 solution (metabuilders defaultbuttons) when I stumbled upon this post by Scott Guthrie which shows that you can simply use the panel control like so:
<asp:panel defaultbutton=”btnOK” runat=”server”>
</asp:panel>
Sweet!
-James

{ 3 comments }
Very nice, I was looking for this same functionality, thanks for the post.
Just make sure you test this if/when you move to a web farm. We had nothing but problems with the generated code in WebResources.axd – we basically inlined the gen’d code:
http://www.jasonbock.net/JB/Default.aspx?blog=entry.53884fc667cf43e59cf77bd613f61740
simply…. i love u for this smart tip.
Comments on this entry are closed.