日期:2014-05-18  浏览次数:20379 次

求解释,很简单
我增加新闻页面,输入标题,是成功的,不输入也是可以的,但输入内容就出问题了,我怀疑是FreeTextBox 
的问题,球解释
代码如下

  protected void Button1_Click(object sender, EventArgs e)
  {
  string newstitle = TextBox1.Text.Trim();
  string newspath = TextBox3.Text.Trim(); string newscontent = ftbContent.Text.Trim();
  string catid = ddl.SelectedValue;

  News n = new News(newstitle, newspath, newscontent, catid);
  bool b = new newsman().Insert(n);
  if (b)
  {
  Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('新闻添加成功!');</script>");
  }
  else
  {
  Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('新闻添加失败,请联系管理员!');</script>");
  }

  // 清空标题和内容
  TextBox1.Text = "";
   
  TextBox3.Text = "";
  }

还有newspath这个字段,我现在又个fileUPLOAD,怎么在这样的情况下,上传图片,求解释

------解决方案--------------------
C# code
你觉得是神马地方出错你就在录入数据库前把那个输出出来看看。看看是神马值,然后你改就行了。挺楼主的意识是好像是字段弄混了