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

📄 editthread.aspx.cs

📁 计算机实验课在线答疑系统 09年毕业设计
💻 CS
字号:
//***********************************************************************
//
// WebExpert.NET 1.0 
//
// (c) 2003, www.AspCool.com. All rights reserved.
// ASP酷技术网版权所有
//
// 网站:http://www.aspcool.com
// 邮箱:tim@aspcool.com
//
// 版权声明:本程序仅供学习使用,你也可以修改后在网站上使用,但使用时必
// 须保留ASP酷技术网(www.AspCool.com)的版权信息和链接。本程序随《ASP.NET
// 网站建设专家》一书赠送,未经作者同意,不得随意修改、传播。
//
// 描述:
//   此文件包含下面的类:
//       EditThread
//
// 作者:     王保健
// 时间:     2004/12/15
//
//************************************************************************

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace book09.bbs
{
	/// <summary>
	/// EditThread 的摘要说明。AspCool.WebExpert.bbs
	/// </summary>
	public partial class EditThread : System.Web.UI.Page
	{ 
        
		int itemId = 0;
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			if (Session["UserName"] == null)
			{
				Response.Redirect(Request.ApplicationPath + "/Users/UserLogin.aspx?returnURL=" + Request.Url.ToString());
			}
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    

		}
		#endregion

		protected void UpdateButton_Click(object sender, System.EventArgs e)
		{
			// Only Update if the Entered Data is Valid
			if (Page.IsValid == true) 
			{
				if (Session["UserName"] == null)
				{
					Response.Redirect(Request.ApplicationPath + "/Users/UserLogin.aspx?returnURL=" + Request.Url.ToString());
				}

				if (Request.Params["ItemId"] != null) 
				{
					itemId = Int32.Parse(Request.Params["ItemId"]);
				}

                
				// Create an instance of the news DB component
				ThreadsDB thread = new ThreadsDB();

				if (itemId == 0) 
				{

					// Add the thread within the threads table
					thread.AddThread(itemId,Session["UserName"].ToString(),Subject.Text ,Content.Text,0,0);
				}
				// Redirect back to the portal home page
				Response.Redirect("ShowThread.aspx");
			}
		}

		protected void CancelButton_Click(object sender, System.EventArgs e)
		{
			Response.Redirect("ShowThread.aspx");		
		}
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Subject.Text = "";
            Content.Text = "";
        }
}
}

⌨️ 快捷键说明

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