---
title: "how to validate number in angularjs asp.net"  
description: "how to validate number in angularjs asp.net"  
author: "Anonymous User"  
published: 2015-11-16  
updated: 2015-11-16  
canonical: https://www.mindstick.com/forum/33600/how-to-validate-number-in-angularjs-asp-dot-net  
category: ".net"  
tags: ["asp.net", "angular js"]  
reading_time: 1 minute  

---

# how to validate number in angularjs asp.net

I want [validate](https://www.mindstick.com/forum/1490/what-is-better-solution-for-validate-form-textboxs-value) number in [angularjs](https://www.mindstick.com/forum/33926/use-angularjs-without-scope-in-mvc) please help me.

## Replies

### Reply by Anonymous User

```
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AngularList.aspx.cs" Inherits="Forumasp.AngularList" %><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" ng-app="UserApp">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-2.1.4.js"></script>
    <script src="Scripts/angular.min.js"></script>
    <script type="text/javascript">
        var app = angular.module('UserApp',        
app.controller('Cntrnum', ['$scope', function ($scope) {
             $scope.val = '1';
         }]);
    </script>
</head>
<body>
<style>  .my-input {
    transition:all linear 0.5s;
    background: transparent;
  }
  .my-input.ng-invalid {
    color:white;    background: red;
  }
</style>

<p id="inputDescription">
 Update input to see transitions when
valid/invalid. Integer is a valid value.
</p>
<form name="testForm" ng-controller="Cntrnum">
Enter Number:  <input ng-model="val" ng-pattern="/^\d+$/" name="anim" class="my-input"
         aria-describedby="inputDescription" />
</form>
</body>
</html>
```

```

```


---

Original Source: https://www.mindstick.com/forum/33600/how-to-validate-number-in-angularjs-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
