很郁闷的菜鸟问题,在线等待回复
我定义一些文本框和一个按钮,想要实现按钮在单击过程中读取到文本框中的值.但是好象是不会执行到按钮的单击事件.具体代码如下:
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 mydingfeng.background
{
/// <summary>
/// functions 的摘要说明。
/// </summary>
public class functions : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Panel Panel2;
protected System.Web.UI.WebControls.Panel Panel1;
//------公告的编写------
Label lb1 = new Label();
TextBox bulTitle = new TextBox();//标题
Label lb2 = new Label();
TextBox bulName = new TextBox();//发布人
Label lb3 = new Label();
FreeTextBoxControls.FreeTextBox bulContent = new FreeTextBoxControls.FreeTextBox();//内容
Label lb4 = new Label();
protected System.Web.UI.WebControls.LinkButton LinkButton1;
TextBox bulTime = new TextBox();//发布时间
Button but1 = new Button();//提交公告内容
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
}
//Panel1.Controls.Clear();//清空面版一中的所有
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.LinkButton1.Click += new System.EventHandler(this.LinkButton1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
//学校公告
private void LinkButton1_Click(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
}
//--------设置公告的各个属性----------
lb1.Text = "公告标题: ";
lb2.Text = "发布人: ";
lb4.Text = "发布时间 ";
bulTime.Text = DateTime.Now.Date.ToString();
lb3.Text = "公告内容: ";
// but1.Text = "确认提交 ";
bulContent.ID= "bulContent ";
lb1.Width=100;
lb2.Width=100;
lb3.Width=100;
lb4.Width=100;
bulTitle.Width=250;
bulName.Width=150;
bulTime.Width=150;
Table table1 = new Table();//定义一个表格
TableRow tbrow1 = new TableRow();
TableRow tbrow2 = new TableRow();
TableRow tbrow3 = new TableRow();
TableCell tbcell1 = new TableCell();