Showing posts with label Validation. Show all posts
Showing posts with label Validation. Show all posts

How to insert valid date in textbox in Asp.net using C#

Posted by Unknown On Friday, 4 October 2013 0 comments
Hi, In this post i describe that how to select the particular valid date from calendar extendar user
not allow to enter invalid date.

For That you have to just use the some ajax control like following way.
before use you have to register the ajax toolkit and put the tool script manager in your code.

<asp:TextBox ID="txtbx_registrationdate" runat="server" CssClass="textbox"  TabIndex="11"></asp:TextBox>

<asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtbx_registrationdate"></asp:CalendarExtender>

READ MORE

Hi, In this post I mentioned that how to allow insert only numeric or float value in textbox. For doing this you have to just put the compare validate control and set the property and you work is done.

First take one text box and then take compartmentalize and set its property as follow.

<asp:TextBox ID="txtbx_issuedqty1" runat="server"></asp:TextBox>

<asp:CompareValidator ID="Cmp1" runat="server" ErrorMessage="Enter Valid Quantity" Type="Double" Operator="DataTypeCheck" ControlToValidate="txtbx_issuedqty1" ForeColor="Red" ValidationGroup="add">*</asp:CompareValidator>

Hope it will help you.
READ MORE

Regular Expression for Website in Textbox in Asp.net using C#

Posted by Unknown On Tuesday, 19 March 2013 0 comments

<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="Enter valid website URL" ControlToValidate="TextBox5" ValidationGroup="val1" ValidationExpression="(http|https)://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"></asp:RegularExpressionValidator>
READ MORE

Regular Expression for Email ID in Textbox in Asp.net Using C#

Posted by Unknown On 0 comments

<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="Email Require" ControlToValidate="TextBox1" ValidationGroup="val1" Text="*"></asp:RequiredFieldValidator>
READ MORE
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Enter valid description" ControlToValidate="TextBox1" ValidationExpression="[0-9]+" ValidationGroup="val1"></asp:RegularExpressionValidator>
READ MORE

<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Enter valid description" ControlToValidate="TextBox1" ValidationExpression="[a-zA-Z ]+" ValidationGroup="val1"></asp:RegularExpressionValidator> 
READ MORE