如题:
<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeFile="fh.aspx.cs" Inherits="fh" %><%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div style="margin-left:auto;margin-right:auto;">
<br />
<br />
内 容:<br />
<FCKeditorV2:FCKeditor ID="content" runat="server" Width="700px" Height="400px">
</FCKeditorV2:FCKeditor><br />
<asp:Button ID="submit" runat="server" Text="提交" OnClick="submit_Click"/>
<input id="Reset1" type="reset" value="返回" onclick="javascript:history.go(-1);"/>
</div>
</form>
</body>
</html>
后台代码是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;
using System.Data.SqlClient;public partial class fh : System.Web.UI.Page
{
//public string cateID = HttpContext.Current.Request.QueryString["cateID"];
protected void Page_Load(object sender, EventArgs e)
{
Datashow();
}
protected void submit_Click(object sender, EventArgs e)
{
string text = content.Value.ToString();
string strsql = cn.sqlstr();
SqlConnection myconn = new SqlConnection(strsql);
myconn.Open();
SqlCommand cmd = new SqlCommand("update gg set upfile='" + text + "' where id=3", myconn);
int result = cmd.ExecuteNonQuery();
if (result > 0)
{
Response.Write("<script>alert('" + text + "');</script>"); //text这个值不知为什么不会变的,,一真是才datashow()那里从数据库的值,,,
Response.Write("<script>alert('修改成功!');window.history.back(-1);window.close();</script>");
//Response.End();
}
myconn.Close();
} private void Datashow()
{ string strsql = cn.sqlstr();
string op = "";
string cmdtext = "select * from gg where id=3";
SqlConnection myconn = new SqlConnection(strsql);
SqlCommand cmd = new SqlCommand(cmdtext, myconn);
myconn.Open();
SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (dr.Read())
{
content.Value = dr["upfile"].ToString();
}
dr.Close(); }
}
前后台代码都在上面了,,不知为什么修改不了,,那位高手指点一下
<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeFile="fh.aspx.cs" Inherits="fh" %><%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div style="margin-left:auto;margin-right:auto;">
<br />
<br />
内 容:<br />
<FCKeditorV2:FCKeditor ID="content" runat="server" Width="700px" Height="400px">
</FCKeditorV2:FCKeditor><br />
<asp:Button ID="submit" runat="server" Text="提交" OnClick="submit_Click"/>
<input id="Reset1" type="reset" value="返回" onclick="javascript:history.go(-1);"/>
</div>
</form>
</body>
</html>
后台代码是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;
using System.Data.SqlClient;public partial class fh : System.Web.UI.Page
{
//public string cateID = HttpContext.Current.Request.QueryString["cateID"];
protected void Page_Load(object sender, EventArgs e)
{
Datashow();
}
protected void submit_Click(object sender, EventArgs e)
{
string text = content.Value.ToString();
string strsql = cn.sqlstr();
SqlConnection myconn = new SqlConnection(strsql);
myconn.Open();
SqlCommand cmd = new SqlCommand("update gg set upfile='" + text + "' where id=3", myconn);
int result = cmd.ExecuteNonQuery();
if (result > 0)
{
Response.Write("<script>alert('" + text + "');</script>"); //text这个值不知为什么不会变的,,一真是才datashow()那里从数据库的值,,,
Response.Write("<script>alert('修改成功!');window.history.back(-1);window.close();</script>");
//Response.End();
}
myconn.Close();
} private void Datashow()
{ string strsql = cn.sqlstr();
string op = "";
string cmdtext = "select * from gg where id=3";
SqlConnection myconn = new SqlConnection(strsql);
SqlCommand cmd = new SqlCommand(cmdtext, myconn);
myconn.Open();
SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
if (dr.Read())
{
content.Value = dr["upfile"].ToString();
}
dr.Close(); }
}
前后台代码都在上面了,,不知为什么修改不了,,那位高手指点一下
解决方案 »
- net中按钮如何调用另一按钮事件
- 一个文件流还没有结束,另一个用户有没有办法对这个文件改写?
- 怎样设置鼠标跟随的文字
- 有关prototype.js库实现ajax的问题
- 帮我看看这段诡异的代码
- 求高手解答vbscript的问题
- 问个不关.net的问题(不务正业),谁做过java/jsp?
- soa到底是什么?谁可以谈谈看法,以及相关的技术
- 用正则表达式如果实现只匹配一次
- 求助:在datalist中再嵌入checkboxlist的问题
- VaryByControl在内容页中不起作用?
- 加上“<!DOCTYPE html PUBLIC "-//W3C//DTD ....”后offsetWidth,offsetHeight等属性会错误。
{
Datashow();
}
{
}
{
Datashow();
}