⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendback.aspx.cs

📁 这个是个未完成品 演示地址:http://www.yyzyq.com 仅以此例给正在学习编程爱好.net的朋友 希望能给大家带来帮助
💻 CS
字号:
using System;
using System.Data;
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;

public partial class SendBack : System.Web.UI.Page
{
    Controls ctrl = new Controls();
    Back back = new Back();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            BindRbl();
    }

    /// <summary>
    /// 绑定心情
    /// </summary>
    private void BindRbl()
    {
        for (int i = 1; i < 19; i++)
        {
            rblHeart.Items.Add("<img alt=\"心情\" src=\"images/heart/face" + i.ToString() + ".gif\" />");
            rblHeart.Items[i - 1].Value = i.ToString();
        }
        rblHeart.Items[0].Selected = true;
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        #region 回复主题
        if (!Equals(UserInfo.GetUserName, null))
        {
            string strContent = ctrl.GetText(txtContent);            
            if (strContent.Length == 0)
                JScript.Alert("回复信息不能为空!");
            else if (strContent.Length > 4000)
                JScript.Alert("回复信息不能超过4000字符!");
            else
            {
                string strBackId = QueryString.GetBackId;
                if (!Equals(strBackId, null))
                {
                    DataView mydv = back.GetBackContent(strBackId);
                    strContent = "<font color=\"#cccc99\">在 " + mydv[0]["name"].ToString() + " 的大作中提到<br>" + mydv[0]["backcontent"].ToString() + "</font><br><br>" + rblHeart.SelectedItem.Text + "&nbsp;" + strContent;
                }
                if (back.AddBack(strContent.Replace("\n","<br>"), UserInfo.GetUserName, QueryString.GetThemeId))
                    Response.Redirect("SavePost.aspx?bigid=" + QueryString.GetBigId + "&smallid=" + QueryString.GetSmallId + "&ThemeId=" + QueryString.GetThemeId);
            }
        }
        else
            Response.Redirect("UserLogin.aspx");
        #endregion
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -