ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.RegularExpression to accepts only integer and float in ASP.Net <p>Hi Swap,</p> <p>Please refer below code</p> <p><span style="text-decoration: underline;">HTML</span></p> <pre class="brush: html">&lt;div&gt; &nbsp;&nbsp;&nbsp; &lt;asp:TextBox ID=&#34;txtNumbers&#34; ValidationGroup=&#34;Numbers&#34; runat=&#34;server&#34; /&gt; &nbsp;&nbsp;&nbsp; &lt;asp:RegularExpressionValidator ControlToValidate=&#34;txtNumbers&#34; ErrorMessage=&#34;Please Enter Correct Details&#34; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ValidationExpression=&#34;([0-9])[0-9]*[.]?[0-9]*&#34; runat=&#34;server&#34; ValidationGroup=&#34;Numbers&#34;&gt; &nbsp;&nbsp;&nbsp; &lt;/asp:RegularExpressionValidator&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;asp:RequiredFieldValidator ErrorMessage=&#34;Please Enter at Least One Digit&#34; ControlToValidate=&#34;txtNumbers&#34; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ValidationGroup=&#34;Numbers&#34; runat=&#34;server&#34; /&gt; &nbsp;&nbsp;&nbsp; &lt;br /&gt; &nbsp;&nbsp;&nbsp; &lt;asp:Button ID=&#34;btnSubmit&#34; Text=&#34;Submit&#34; ValidationGroup=&#34;Numbers&#34; runat=&#34;server&#34; /&gt; &lt;/div&gt;</pre> <p><span style="text-decoration: underline;">ScreenShot</span></p> <p><img src="https://i.imgur.com/FjI6ecj.gif" alt="" width="379" height="147" /></p>https://www.aspforums.net:443/Threads/543494/RegularExpression-to-accepts-only-integer-and-float-in-ASPNet/https://www.aspforums.net:443/Threads/543494/RegularExpression-to-accepts-only-integer-and-float-in-ASPNet/Thu, 30 Jun 2016 04:15:04 GMT