Click here to Skip to main content
11,706,979 members (49,862 online)
Click here to Skip to main content

Tagged as

How to clear a Multiple TextBox values in a single click in C# .NET

, 26 Sep 2011 CPOL 62.2K 15
Rate this:
Please Sign up or sign in to vote.
Using this method, we can clear the text stored in a textbox easily.
protected void Button2_Click(object sender, EventArgs e)
void ClearInputs(ControlCollection ctrls)
    foreach (Control ctrl in ctrls)
        if (ctrl is TextBox)
            ((TextBox)ctrl).Text = string.Empty;


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Junior) CS1401
India India

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

You may also be interested in...

Comments and Discussions

GeneralRe: ya its real. Thanks for your code.;) Pin
CS140120-Sep-11 19:57
memberCS140120-Sep-11 19:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150819.1 | Last Updated 27 Sep 2011
Article Copyright 2011 by CS1401
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid