Home     About PeterBlum.com     Policies     Download a Licensed Product     Newsletter
Peter's Interactive Pages
Submitting the Page

The Peter's Interactive Pages module enhances the page submission process with these techniques:

  • Prompts to confirm saving the page on submit. Both the Submit and Cancel buttons have separate messages in this example. When you cancel either one, it stops the page from being submitted.
    You will see these prompts as the ConfirmMessage properties on the <des:Button> controls.
  • Disable the Submit button to limit double submissions. You have to submit the page to see it disabled.
    These are setup with the DisableSubmit property on the <des:Button> controls.
  • When focus is in the TextBox, it allows ENTER to click Submit and ESC to click Cancel. On an Internet Explorer browser with only one input field, IE does not click the default button. DES's feature here works around that problem easily.
    The ENTER feature uses the EnterSubmitControlID property on the Submit control. The ESC feature uses the PeterBlum.DES.Globals.WebFormDirector.RegisterKeyClicksControl method to connect the TextBox to the Cancel button.


ASP.NET Syntax for this demo

<des:TextBox ID="TextBox1" runat="server" EnterSubmitsControlID="Button1" />
<des:RequiredTextValidator ID="RequiredTextValidator1" runat="server" 
   ControlIDToEvaluate="TextBox1" ErrorMessage="This field requires an entry" />
<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" />

Setting these attributes on the page

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