📄 sendback.aspx.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 + " " + 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 + -