SiteAdmin/Aspx/GuestbookEdit.aspx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class SiteAdmin_Aspx_GuestbookEdit : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Cookies["roleid"] != null)
        {
            if (!IsPostBack)
            {
                binddr();
            }
        }
        else
        {
            MessageBox.ShowAndRedirect(this.Page, "对不起!您还没有登录系统。", "../Logout.aspx");
        }
    }
    public void binddr()
    {
        try
        {
            Guestbooks myn = new Guestbooks();
            myn.GetModel(Convert.ToInt16(Request.QueryString["ID"].ToString()));
            LitLyTime.Text = myn.LyTime.ToString();
            TextBox_Title.Text = myn.Title;
            TextBox_Content.Text = myn.Content;
  
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    protected void LinkButton_Add_Click(object sender, EventArgs e)
    {

    string Title = TextBox_Title.Text.Trim();
    string Content = TextBox_Content.Text;
    DateTime HfTime = DateTime.Now;

    Guestbooks myn = new Guestbooks();
    myn.ID = Convert.ToInt16(Request.QueryString["ID"].ToString());
    myn.Title = Title;
    myn.Content = Content;
    myn.HfTime = HfTime;
    myn.IsSH = 1;
    myn.Update();

    ClientScript.RegisterStartupScript(this.GetType(), "success", "<script type=\"text/javascript\">alert(\" 编辑保存成功!\")</script>");
     
    }
   
}

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

AI 解读 AI

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

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