Question: I have this code in the button click event. The issue is I want to show the text "Thread has been added successfully" every time the textboxes get validated and submitted and want to clear that label after submission. Is there any way to do that?

```
protected void BtnThread_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            LabelThread.ForeColor = System.Drawing.Color.Purple;
            LabelThread.Text = "Thread has been added successfully";
        }

        else
        {

            LabelThread.Text = "Thread couldnot not be added";

        }

        Thread obj = new Thread();
        obj.Insert_thread = TxtBoxThread.Text;

        int j = obj.insertmethod();

        TxtBoxThread.Text = "";

```

Answer: 
You should make this change ->

```
                    while ((line = br.readLine()) != null) {
                            list.add(line);
                    }

```
The stacktrace is telling you what the error is. The variable `path` has not been assigned when the instance of `FileReader` is created.

You're assigning `file_name` to a variable that is never used. Replace

```
String file = path;

```

with

```
path = file_name;

```

Also don't forget to assign the variable `line` 

```
while ((line = br.readLine()) != null) {

```

so that it can be assigned a value to add to the `ArrayList`