I have a form that submits to a thank you page, but the problem is that if you hit the back button, the fields are still filled. I want the form to be cleared when user hit submit button, and not sure of the syntax in asp mvc.
In web form I would do
txtName.Text = " ";
In MVC I tried
model.Name = " ";
model.Name = null;
also tried
ModelState.Clear();
neither works
Here is what I have on the form to clear the field
using (var smtp = new SmtpClient())
{
var credential = new NetworkCredential
{
UserName = "email@email.com",
Password = "password"
};
smtp.Credentials = credential;
smtp.Host = "smtpout.secureserver.net";
smtp.Port = 3535;
smtp.EnableSsl = false;
await smtp.SendMailAsync(message);
await smtp.SendMailAsync(CustomerMsg);
model.Name = null;
model.Name = "";
ModelState.Clear();
return RedirectToAction("Sent");
}