.net中的一个界面把数据传递到text中了然后修改text的内容添加到数据库时不能修改
就是那个传递过来的text的值没法修改了
protected void Page_Load(object sender, EventArgs e)
{
int id = int.Parse(Request["id"]);
SqlDataReader reader = NewsManager.selectid(id);
type1.Text = reader["news_type"].ToString();
title1.Text = reader["news_title"].ToString();
content1.Text = reader["news_content"].ToString();
reader.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
int id = int.Parse(Request["id"]);
news news1 = new news();
news1.News_type =
type1.Text.ToString();
news1.News_title =
title1.Text.ToString();
news1.News_content =
content1.Text.ToString();
int row = NewsManager.update(id,news1);
if (row > 0)
{
Response.Redirect("Edit.aspx");
}
else
{
Response.Write("<script>alert('修改失败!')</script>");