title: validation for textbox setting dashes(-) automatically
body: <p>i have this code m trying to validate it but unable to so what i want it to look like this <code>12-12345-1-1</code> when the user types in the text box it should be able to get the dashes automatically is this possible through <em>C#</em> or <em>j-query</em></p>
  
  <pre><code>&lt;asp:TextBox ID="txtNum" runat="server" placeholder="number" class="form-control" OnTextChanged="txtNum_TextChanged1" &gt;&lt;/asp:TextBox&gt;
  &lt;asp:RegularExpressionValidator ID="regxNum" ValidationExpression="\d{3}\d{3}\d{4}" runat="server" ErrorMessage="Invalid Num#" ControlToValidate="txtNum" ForeColor="Red"&gt;&lt;/asp:RegularExpressionValidator&gt;
  </code></pre>
  
  <p><strong>C#</strong></p>
  
  <pre><code>if ((txtNum.Text.ToString().Length == 2) || (txtNum.Text.ToString().Length == 5) || (txtNum.Text.ToString().Length == 1))
        txtNum.Text = txtNum.Text.ToString() + "-";
  </code></pre>