The Peter's Interactive Pages module enhances the page submission process with these techniques:
<des:TextBox ID="TextBox1" runat="server" EnterSubmitsControlID="Button1" /> <des:RequiredTextValidator ID="RequiredTextValidator1" runat="server" ControlIDToEvaluate="TextBox1" ErrorMessage="This field requires an entry" /> <br/> <des:Button ID="Button1" runat="server" Text="Submit" ConfirmMessage="The data appears valid. Do you want to save it?" DisableOnSubmit="True" /> <des:Button ID="Button2" runat="server" Text="Cancel" ConfirmMessage="This page has not been saved. Do you want to abandon any changes?" CausesValidation="False" DisableOnSubmit="True" />
You would assign these values in your Page_Load method:
PeterBlum.DES.Globals.WebFormDirector.InitialFocusControl = TextBox1 PeterBlum.DES.Globals.WebFormDirector.RegisterKeyClicksControl(TextBox1, Button2, 27, true) PeterBlum.DES.Globals.WebFormDirector.SubmitOrder = PeterBlum.DES.Web.SubmitOrderType.ValidateConfirmCustom