상세 컨텐츠

본문 제목

F5기능 refresh 자바스크립트 소스

ASP.NET

by happynuri 2007. 8. 10. 18:28

본문

 SqlConnection conn = null;
        SqlCommand delcomm = null;

        int count = 0;

        using (conn = new SqlConnection(connstr))
        {
            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }


            delcomm = new SqlCommand(DelCmt, conn);

            delcomm.Parameters.AddWithValue("@id", this.hdnCid.Value.Trim());
           
            count = delcomm.ExecuteNonQuery();

            if (conn.State == ConnectionState.Open)
            {
                conn.Close();
            }
        }

        if (count > 0)
        {
          //자기자신이 자기자신을 불러오는 부분
            string s = string.Format("<script>alert('{0}') ; {1}</script>", "삭제성공 ", " document.location.href=document.location.href;");
            Response.Write(s);
        }
        else
        {
            string s = string.Format("<script>alert('{0}')</script>", "삭제실패");
            Response.Write(s);
            return;
        }

관련글 더보기

댓글 영역