温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:博客源代码(课程设计,3层架构)
当前文件:
MVCBlog/Admin/EditHuifu.aspx.cs,打开代码结构图
MVCBlog/Admin/EditHuifu.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
12
public partial class Admin_EditHuifu : System.Web.UI.Page 13
{ 14
string id = null; 15
protected void Page_Load(object sender, EventArgs e) 16
{ 17
if (!IsPostBack) 18
{ 19
try 20
{ 21
22
id = Request.QueryString["id"].ToString(); 23
liuyan ly = new liuyan(); 24
LiuyanOperation lyo = new LiuyanOperation(); 25
ly = lyo.getByAid(id); 26
TextBox1.Text = ly.huifu; 27
} 28
catch 29
{ } 30
} 31
} 32
protected void Button1_Click(object sender, EventArgs e) 33
{ 34
id = Request.QueryString["id"].ToString(); 35
liuyan ly = new liuyan(); 36
LiuyanOperation lyo = new LiuyanOperation(); 37
ly = lyo.getByAid(id); 38
string t = TextBox1.Text.ToString(); 39
ly.huifu = t; 40
bool b=lyo.update(ly); 41
if (b) 42
Response.Write("回复更新成功!"); 43
Response.Redirect("../Liuyan.aspx"); 44
} 45
} 46





}
}