asp.net修改代码问题
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 administrator_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["id"] != null)
{
this.binddata();
}
else
{
Response.Redirect("loginin.aspx");
}
}
}
protected void binddata()
{
if (Request.QueryString["id"].ToString() != null)
{
int hid = Convert.ToInt32(Request.QueryString["id"].ToString().Trim());
string strsql = string.Format("select * from jiazhiqixi where id={0}", hid);
DataSet ds = Helper.ExecuteDataSet(strsql);
foreach (DataRow dr in ds.Tables[0].Rows)
{
this.txtNewsTitle.Text = dr["title"].ToString();
this.FCKeditor1.Value = dr["content"].ToString();
Response.Write(dr["title"].ToString());
}
}
}
private void updatadata()
{
int id = Convert.ToInt32(Request.QueryString["id"].ToString().Trim());
string title = this.txtNewsTitle.Text;
string content = this.FCKeditor1.Value;
string strsql12 = string.Format("update jiazhiqixi set title='{0}'',content='{1}' where id={2}", title, content, id);
try
{
Helper.ExecuteNonQuery(strsql12);
Response.Write("<script>alert('修改成功')</script>");
Response.Write("<script>location.href='jiazhiqixi.aspx'</script>");
}
catch
{
Response.Write("<script>alert('请确定你编辑的内容')</script>");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Request.QueryString["id"].ToString().Trim() != null)
{
updatadata();
Response.Redirect("jiazhiqixi.aspx");
}
}
}可以得到文件,但是修改不成功!麻烦各位帮忙看看
追问:额晕,大意,谢谢了