AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 how to clear the textboxes enterd data in asp.net with c#
Posted by charan on  3/17/2010 5:08:04 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
iam using asp.net2.0 with c#,in my website iam using
requiredfield validators and ajax controls if iam entered any incorrect values in textboxes then i want to clear the text boxes then i have return the code for clearing the controls in clear button . but when i click clear button then validation controls and ajax validator callout extenders is displaying and the textboxes are not clearing. how to solve this situations please give me example which helps me

Post Your Reply Post New Question

 Viewer's Reply
Set CauseValidation Property for TextBox
Answered By Moderator1 on 3/19/2010 10:30:17 PM
Hi,

Set the CauseValidation Property of the Clear Button for False, then write the code to clear the textbox.

<asp:Button ID="Button1" runat="server"
CausesValidation="False" OnClick="Button1_Click" Text="Clear" />
 
iyt really helps
Answered By charan on 3/20/2010 12:21:00 AM
thanks for aspdotnetcodes team
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
The Beginner's Guide to Joomla
When Good HTML Goes Bad: How You Can Protect Your Web Applications
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!