ComponentOne Input for ASP.NET AJAX: Input for ASP.NET AJAX Task-Based Help > C1MaskedInput Tasks > Displaying the Date Mask without Prompt Characters

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 C1MaskedInput 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 C1MaskedInput 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:

 

<cc1:C1MaskedInput ID="C1MaskedInput1" runat="server" Mask="00/00/0000" PromptChar=" ">

</cc1:C1MaskedInput>

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

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

      Visual Basic

With C1MaskedInput1

    .Mask = "00/00/0000"

    .PromptChar = " "

End With

      C#

this.C1MaskedInput1.Mask = "00/00/0000";

this.C1MaskedInput1.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:

 


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.