The problem was that when I click the button, it reads the text but even after it is finished, the page is still waiting for localhost, so I thought maybe I should instantiate the reader on page load only as I did in the code below, getting a NullReferenceException
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Label1.Text = "click button";
reader = new SpeechSynthesizer();
}
else
{}
}
protected void Button1_Click(object sender, EventArgs e)
{
reader.SpeakAsync(TextBox1.Text);//getting the error here
Label1.Text = "SPEAKING";
}