Input for ASP.NET WebForms
Displaying the Date Mask without Prompt Characters
Task-Based Help > C1InputMask Tasks > Displaying the Date Mask without Prompt Characters

To create an input box for the date that does not contain prompt characters (for example, "  /  /    "), use the C1InputMask control and set the PromptChar property to space, " ".

To create a short date mask without prompt characters using the Tasks menu:

To create a Short Date input box that does not contain prompt characters, complete the following tasks:

  1. Open the C1InputMask Tasks menu and click the Mask property's ellipsis button to open the Input Mask dialog box.
  2. Choose Short Date for the mask value and click OK.
  3. With the Tasks menu still open, type a space character (" ") in the PromptChar text box. Note that you must delete the default underscore (_).

To create a short date mask without prompt characters using .html markup:

To create a Short Date input box that does not contain prompt characters, use the following markup in the .aspx page:

To write code in Source View

<cc1:C1InputMask ID="C1InputMask1" runat="server" Mask="00/00/0000" PromptChar=" ">
</cc1:C1InputMask>

To create a short date mask without prompt characters using code:

To create a short date mask without prompt characters for the C1InputMask control, double-click the Web page to create an event handler for the Load event. Enter the following code for the Page_Load event:

To write code in Visual Basic

Visual Basic
Copy Code
With C1InputMask1
    .MaskFormat = "00/00/0000"
    .PromptChar = " "
End With                           

To write code in C#

C#
Copy Code
this.C1InputMask1.MaskFormat = "00/00/0000";
this.C1InputMask1.PromptChar = char.Parse(" ");                            

This topic illustrates the following:

Run the project and notice that the Short Date mask is displayed without prompt characters, as shown here: