📄 coment.aspx.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace novel
{
public partial class coment : System.Web.UI.Page
{
DB_Class pdb = new DB_Class();
protected void Page_Load(object sender, EventArgs e)
{
GetList_topic();
}
public void GetList_topic()
{
List_Comment.DataSource = pdb.dst("select sender,content,times from novel_comment ").Tables[0].DefaultView;
List_Comment.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
String insert = "insert into novel_comment(content) values('" + TextBox_comment.Text + "') ";
if (pdb.ExecSql(insert))
{
GetList_topic();
Page.ClientScript.RegisterStartupScript(this.GetType(), "MessageBox", "alert('保存成功')", true);
}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "MessageBox", "alert('保存失败,请检查!')", true);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -