InputMask promptChar

By default, the InputMask control uses an underscore character to indicate positions where input is expected.

You can change this by assigning a new string to the promptChar property:




1
2
3
4
5
6
7
8
9
10
11
12
13
using System.Web.Mvc;
 
namespace LearnMvcClient.Controllers
{
    public partial class C1InputController : Controller
    {
        // GET: InputMaskPromptChar
        public ActionResult InputMaskPromptChar()
        {
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<h1>
    @Html.Raw(Resources.C1Input.InputMaskPromptChar_Title)
</h1>
 
<p>
    @Html.Raw(Resources.C1Input.InputMaskPromptChar_Text1)
</p>
<p>
    @Html.Raw(Resources.C1Input.InputMaskPromptChar_Text2)
</p>
 
<div class="demo-settings">
    <label for="theSSN">@Html.Raw(Resources.C1Input.InputMaskPromptChar_Text3)</label>
    @Html.C1().InputMask().Id("theSSN").Mask("000-00-0000").PromptChar('*')
    <br>
    <label for="theZip">@Html.Raw(Resources.C1Input.InputMaskPromptChar_Text4)</label>
    @Html.C1().InputMask().Id("theZip").Mask("00000").PromptChar('^')
    <br>
    <label for="theZip4">@Html.Raw(Resources.C1Input.InputMaskPromptChar_Text5)</label>
    @Html.C1().InputMask().Id("theZip4").Mask("00000-0000").PromptChar('#')
    <br>
    <label for="thePhone">@Html.Raw(Resources.C1Input.InputMaskPromptChar_Text6)</label>
    @Html.C1().InputMask().Id("thePhone").Mask("(999) 000-0000").PromptChar(' ')
</div>