温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:淘淘网电子商务网站源码(毕业设计)
当前文件:
TaoTaoBiz/Admin/AddOther.aspx.cs,打开代码结构图
TaoTaoBiz/Admin/AddOther.aspx.cs,打开代码结构图1using System; 2
using System.Collections; 3
using System.ComponentModel; 4
using System.Data; 5
using System.Drawing; 6
using System.Web; 7
using System.Web.SessionState; 8
using System.Web.UI; 9
using System.Web.UI.WebControls; 10
using System.Web.UI.HtmlControls; 11
using web.Code; 12
13
namespace web.Admin 14
{ 15
/// <summary> 16
/// AddOther 的摘要说明。 17
/// </summary> 18
public partial class AddOther : System.Web.UI.Page 19
{ 20
21
protected void Page_Load(object sender, System.EventArgs e) 22
{ 23
// 在此处放置用户代码以初始化页面 24
ImageButton1.Attributes.Add("onclick", "return btnOpen_Click();"); 25
} 26
27
Web 窗体设计器生成的代码 46
47
protected void btnAdd_Click(object sender, System.EventArgs e) 48
{ 49
InformationVO informationVO = new InformationVO(); 50
informationVO.CategoryId = Convert.ToInt32( DropDownList1.SelectedValue.ToString() ); 51
informationVO.Title = TextBox1.Text.Trim(); 52
informationVO.Content = TextBox2.Text.Replace("\n","<br>"); 53
informationVO.AddDate = DateTime.Now.ToString(); 54
55
InformationDAO informationDAO = new InformationDAO(); 56
if( informationDAO.addInformation( informationVO ) != 0 ) 57
{ 58
TextBox1.Text=null; 59
TextBox2.Text=null; 60
DropDownList1.SelectedIndex=0; 61
Response.Write("<script>alert('新闻已经添加!')</script>"); 62
} 63
} 64
} 65
} 66





}