<ig:WebMaskEditor ID="WebMaskEditor1” runat="server"
InputMask="###-##-####"/>
This topic demonstrates how to get and set the WebMaskEdito r™ input masks dynamically.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The following table lists the configurable aspects of the WebMaskEditor control:
In order to get or set the WebMaskEditor mask on the server, you simply need to get or set the control property called ` InputMask`.
The code below demonstrates how to set the WebMaskEditor input mask on the server using the markup or code-behind:
In ASPX:
<ig:WebMaskEditor ID="WebMaskEditor1” runat="server"
InputMask="###-##-####"/>
In C#:
this.WebMaskEditor1.InputMask = "###-##-####";
The code below demonstrates how to get the WebMaskEditor input mask on the server:
In C#:
string inputMask = this.phoneEditor.InputMask;
The WebMaskEditor client-side object model proposes two methods for getting and setting the input mask. They are ` get_inputMask()` and ` set_inputMask()`. In a scenario when you need to change the mask dynamically, this will save you from having to make a request to the server in order to configure the WebMaskEditor .
The code below demonstrates how the ` set_inputMask()` method is used to set the WebMaskEditor input mask dynamically on the client:
In JavaScript:
$find("<%= this.WebMaskEditor1.ClientID %>").set_inputMask(“###-##-####”);
The code below demonstrates how the ` get_inputMask()` method is used to get the WebMaskEditor input mask dynamically on the client:
In JavaScript:
var mask = $find("<%= this.WebMaskEditor1.ClientID %>").get_inputMask();
The following topics provide additional information related to this topic:
The following samples provide additional information related to this topic: