Click here to Skip to main content
15,886,094 members
Articles / Programming Languages / C# 4.0

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

Rate me:
Please Sign up or sign in to vote.
4.43/5 (7 votes)
22 Sep 2011CPOL 15.4K   2  
A generic text clear method for those ASP.NET controls which implement the ITextControl interface:private void Clear(ControlCollection controlCollection) where T : ITextControl{ if (controlCollection == null) return; ...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
26 Sep 2011CS1401 2 alternatives  
Using this method, we can clear the text stored in a textbox easily.
Please Sign up or sign in to vote.
2 Oct 2011kris444
We can better have an extension like: public static class ControlExtension { public static IList FindControlByName(this Control control) where T : Control { List controlsFound = new List(); controlsFound.AddRange(control.Controls.OfType()); ...

License

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


Written By
Software Developer
Australia Australia

Comments and Discussions