Tuesday, November 29, 2011 | |

How to Clear all textbox field in one form...?

mostly we are using in asp.net page redirect same page or using null values in each textbox.text... 

now i am using simple way ....get all textboxes in single textbox array and run the loop for example coding is..... 

public void empty()
        {
            TextBox[] textempty = { txtcategoryname, txtshortcode, txtdescription };
            for (int i = 0; i < textempty.Length; i++)
            {
                textempty.Text = string.Empty;
            }
        }

0 comments:

Post a Comment