void btnPost_Click(object sender, EventArgs e) { if (this.Page.IsValid) { FeedbackInfo model = new FeedbackInfo(); model.Content = this.txtContent.Text; model.Email = this.txtEmail.Text; model.Phone = this.txtPhone.Text; model.RealName = this.txtRealName.Text; model.IP = Goodspeed.Common.BrowserInfo.Current.IP; int i = FeedbackMange.Add(model); if (i > 0) { this.ltMsg.Text = "留言成功!"; } else { this.ltMsg.Text = "留言失败"; } this.txtRealName.Text = string.Empty; this.txtPhone.Text = string.Empty; this.txtEmail.Text = string.Empty; this.txtContent.Text = string.Empty; } }
protected void Page_Load(object sender, EventArgs e) { if (CECRequest.GetQueryString("action").ToLower() == "del") { FeedbackMange.Delete(CECRequest.GetQueryInt("id", 0)); Response.Redirect("list.aspx"); } }