要的结果是这样的
添加内容aspx代码
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td style="width: 550px">
<asp:TextBox ID="name" runat="server" ></asp:TextBox></td>
</tr>
<tr>
<td style="width: 550px; height: 355px;">
<asp:TextBox ID="txtContent" runat="server" style="display:none;"></asp:TextBox>
<iframe src='eWebEditor/ewebeditor.htm?id=txtContent&style=coolblue&savefilename=editFirstImageName' frameborder='0' scrolling='no' width='100%' height='350'></iframe> <br />
</td>
</tr>
<tr>
<td style="width: 550px">
<asp:Button ID="Enter" runat="server" Text="提交" OnClick="Enter_Click" />
<input name="editFirstImageName" type="hidden" id="editFirstImageName" value="" runat="server" /> //加上这句也不行
<input id="Reset1" type="reset" value="重写" /></td>
</tr>
<tr>
<td style="width: 550px; height: 21px;">
<asp:Label ID="message" runat="server"></asp:Label></td>
</tr>
<tr>
<td >
<asp:TextBox ID="News_UploadImage" runat="server" Width="241px"></asp:TextBox>
<asp:CheckBox ID="News_isPic" runat="server"
Text=" 设为图片新闻"/></td>
</tr>
</table>
</div>
</form>
</body>
aspx.cs代码
protected void Enter_Click(object sender, EventArgs e)
{
string myconn;
string N_PIC = Request["editFirstImageName"]; //取不到值,如何得到图片路径
string Edittext = new Common().GetText(txtContent.Text);
//string N_PIC = News_UploadImage.Text;//获取文本框中的图片
myconn = ConfigurationManager.ConnectionStrings["lybConnectionString"].ConnectionString;
OleDbConnection conn = new OleDbConnection(myconn);
conn.Open();
string OleDb;
OleDb = "insert into news ([name],[content],[imge]) values ('" + this.name.Text + "','" + Edittext + "','" + N_PIC + "')";
OleDbCommand comm = new OleDbCommand(OleDb, conn);
comm.ExecuteNonQuery();
message.Text = "写入成功 ";
conn.Close();
btnClear_Click();
}
保存到数据库后中是这样:数据库结构为:
ID
CONENT
PIC
1
也是我国在进入全面建设小
File/2008-10-03-15-14-22.jpg
康社会推进社会主义现代化
建设新的发展的一次重要的
代表大会。
<IMG id=eWebEditor_TempElement_Img src="File/2008-10-03-15-14-22.jpg" width=200 border=0>
加深对其深刻内涵和精神实质的理解
[[it] 本帖最后由 zkh 于 2008-10-4 16:41 编辑 [/it]]