먼저 팝업 창에 "삽입 성공"메시지를 표시하려고합니다. 그러면 페이지가 다른 페이지로 리디렉션됩니다. 그러나 Java 스크립트 뒤에 Response.Redirect를 추가하면 메시지 상자가 표시되지 않고 다음 페이지로 이동합니다. 당신의 도움을 주셔서 감사합니다!
try
{
connnew.Open();
cmdnew.ExecuteNonQuery();
string message = "Form Generated Successfully";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<script type = 'text/javascript'>");
sb.Append("window.onload=function(){");
sb.Append("alert('");
sb.Append(message);
sb.Append("')};");
sb.Append("</script>");
ClientScript.RegisterClientScriptBlock(form1.GetType(), "alert", sb.ToString());
Response.Redirect("AllRecords.aspx");
}
하는 대신 ..
Response.Redirect("AllRecords.aspx");
시도해 볼 수 있습니다 ..
Response.AddHeader("REFRESH","5;URL=AllRecords.aspx");
이렇게하면 리디렉션이 5 초 동안 지연됩니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다