asp.net 및 C#에 제출 버튼이있는 양식이 하나 있습니다. 양식은 이메일을 통해 웹 사이트 웹 마스터에게 의견을 제출하기위한 것입니다. C# 코드는 아래와 같습니다.양식 게시물 관련 관련
그러나 한 가지 문제가 있습니다. 즉, 페이지를 새로 고칠 때 다시 게시로 인해 이메일에 주석을 보냅니다. 어떻게 이것을 피할 수 있습니까? 코드는 다음과 같습니다.
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string body = "";
//body = body + "<html><head></head><body>";
body = body + "Dear Balvignan Team,\r\n";
if (txtComment.Text != null)
{
body = body + "Comment: " + txtComment.Text;
}
if (SendEmail(txtEmail.Text.Trim(), "Comment", body, false) == true)
{
lblContactAcknowledge.Text = "Thank You For <br />Submitting comment.";
lblContactAcknowledge.Visible = true;
PnlTalkToUs.Visible = false;
}
else
{
lblContactAcknowledge.Visible = false;
PnlTalkToUs.Visible = true;
}
}
SendEmail은 전자 메일을 보내는 기능입니다. 당신의 Page_Load 이벤트
확인 페이지로드에, 그것 이잖아. – Maxymus