protected void btnSubmitReco_Click(object sender, EventArgs e) { try { string[] words = txtRecommendation.Text.Split(',', ' ', '.'); if (words.Length > 750) { lblRecoText.Text = "*You can enter only 750 words"; } else { if (status == false) { status = true; } rta.UpdateStatus(status, recoPath, int.Parse(recoID), int.Parse(appID)); using (StreamWriter writer = new StreamWriter(recoPath, true)) //// true to append data to the file { writer.WriteLine(txtRecommendation.Text); } StudentTableAdapter sta = new StudentTableAdapter(); stFirstName = sta.GetFirstName(int.Parse(appID)); stLastName = sta.GetLastName(int.Parse(appID)); string url = string.Format("recoSuccess.aspx?name={0}", Server.UrlEncode(stFirstName + " " + stLastName)); Response.Redirect(url, false); } } catch (Exception ex) { Response.Redirect("Exception.aspx"); } }