62,041
社区成员
发帖
与我相关
我的任务
分享
//获取当前信息并添加到数据库里
protected void ButtonSpeak_Click(object sender, System.EventArgs e)
{
//获取用户输入的发言信息
string userName=Session["user_name"].ToString(); //用户名
string createTime=System.DateTime.Now.ToLongTimeString();//发言时间
string content=TextBoxContent.Text; //发言内容
string color=DropDownListColor.SelectedItem.Value; //颜色
string emotion=DropDownListEmotion.SelectedItem.Value; //表情
Message message=new Message(); //实例化Message类
message.Add(userName,createTime,content,color,emotion); //利用Message类的Add方法,向数据库添加留言
//清空发言框
TextBoxContent.Text="";
}
//至此此条发的信息就显示在 iframe1里了 怎么搞的