UI/aadmin/newsadd.aspx.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using System.Data.SqlClient;
using Common;
public partial class admin_newsadd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            _source.Text = "新闻网";
            datablind();

        }
    }
    protected void datablind()
    {
        string str = "  select * from newscate ";
        DataSet ds = DB.dataSet(str);
        DropDownList3.DataSource = ds.Tables[0];
        DropDownList3.DataBind();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        _title.Text = "";
        author.Text = "";
        DropDownList1.SelectedValue = "0";
        DropDownList2.SelectedValue = "0";
        FCKeditor1.Value = "";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Model.News mn = new Model.News();
        BLL.News bn = new BLL.News();
        mn.Title = _title.Text;
        mn.From = _source.Text;
        mn.Author = author.Text;
        mn.Content = FCKeditor1.Value;
        mn.Top = Convert.ToInt32( DropDownList1.SelectedValue);
        mn.Ispic = Convert.ToInt32(DropDownList2.SelectedValue);
        mn.Cateid = Convert.ToInt32(DropDownList3.SelectedValue);
        int result = bn.add(mn);
        //Response.Write(_title.Text);
        //Response.Write(author.Text);
        if (result > 0)
        {
            Response.Write("<script>alert('添加成功'),location.href='newsadd.aspx'</script>");
        }
        else
        {
后面还有 9 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。