ReplyDelete.aspx |
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Delete.aspx.cs" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <h3>글 삭제</h3> <div> <asp:Label ID="lblNum" runat="server" 번 글을 삭제하시겠습니까?<br /> 암호 : <asp:TextBox ID="txtPassword" runat="server" <asp:Button ID="btnDelete" runat="server" Text="삭제" onclick="btnDelete_Click1" /> <br /> <asp:Label ID="lblError" runat="server" </div> </div> </form> </body> </html> |
ReplyDelete.Cs |
using System; using Reply.Bsl; using Reply.Entity; public partial class Reply_Delete : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // 넘겨져 온 번호 값 검사 if (String.IsNullOrEmpty(Request["Num"])) { Response.Write("잘못된 요청입니다."); Response.End(); } else { // 레이블에 넘겨져 온 번호 값 출력 this.lblNum.Text = Request["Num"]; } } protected void btnDelete_Click1(object sender, EventArgs e) { ReplyBiz rb = new ReplyBiz(); // 트랜잭션 처리 클래스에서 객체 생성 ReplyEntity re = rb.SelectReplyByNum int result = rb.DeleteReply if (result == -1) { lblError.Text = "암호가 틀립니다."; } else { Response.Redirect("List.aspx"); } } } |
'.Net Project > ASP.NET 3.5 Sp1' 카테고리의 다른 글
42장 데이터 컨트롤(ADO.NET) (0) | 2009.10.27 |
---|---|
41-10장 답변형 게시판(Common) (0) | 2009.10.27 |
41-8장 답변형 게시판(View) (0) | 2009.10.27 |
41-7장 답변형 게시판(Modify) (0) | 2009.10.27 |
41-6장 답변형 게시판(List) (0) | 2009.10.27 |