FreeTextBox 黏贴时保存 失败
我在aspx 页面里 放了一个 FreeTextBox ,如果手输内容时,保存行 ,如果是复制在别处黏贴的,无缘无故多了很多空格 , 保存时则失败aspx 文件上
<div style="margin:10px; width:810px; height:240px;">
<FTB:FreeTextBox ID="txtCon" runat="server" Width="800" Height="220"></FTB:FreeTextBox>
</div>
cs 代码
protected void btnSend_Click(object sender, EventArgs e)
{
Msg m = new Msg(); // 一个类,用于进行消息的操作
m.MsgTitle = this.txtTitle.Text;
m.MsgBody = this.txtCon.Text;
m.Sender = Convert.ToInt32(Session["uid"]);
m.Receive = Convert.ToInt32(this.dblcSender.SelectedValue);
m.RegDate = Convert.ToDateTime(DateTime.Now.ToShortDateString());
m.FN1 = null; m.FN2 = null; m.FN3 = null;
m.FNURL1 = null; m.FNURL2 = null; m.FNURL3 = null;
if (this.file_1.PostedFile.FileName.Length > 0)
{
string fn1 = this.file_1.PostedFile.FileName;
long fname1 = DateTime.Now.Ticks + 4L;
m.FN1 = fn1.Substring(fn1.LastIndexOf("\\") + 1);
m.FNURL1 = "../upload/" + fname1.ToString() + fn1.Substring(fn1.LastIndexOf("."));
this.file_1.PostedFile.SaveAs(Server.MapPath("../upload") + "\\" + fname1.ToString() + fn1.Substring(fn1.LastIndexOf(".")));
}
if (this.file_2.PostedFile.FileName.Length > 0)
{
string fn2 = this.file_2.PostedFile.FileName;
long fname2 = DateTime.Now.Ticks + 5L;
m.FN2 = fn2.Substring(fn2.LastIndexOf("\\") + 1);
m.FNURL2 = "../upload/" + fname2.ToString() + fn2.Substring(fn2.LastIndexOf("."));
this.file_2.PostedFile.SaveAs(Server.MapPath("../upload") + "\\" + fname2.ToString() + fn2.Substring(fn2.LastIndexOf(".")));
}
if (this.file_3.PostedFile.FileName.Length > 0)
{
string fn3 = this.file_3.PostedFile.FileName;
long fname3 = DateTime.Now.Ticks + 6L;
m.FN3 = fn3.Substring(fn3.LastIndexOf("\\") + 1);
m.FNURL3 = "../upload/" + fname3.ToString() + fn3.Substring(fn3.LastIndexOf("."));
this.file_3.PostedFile.SaveAs(Server.MapPath("../upload") + "\\" + fname3.ToString() + fn3.Substring(fn3.LastIndexOf(".")));
}
if (mbc.saveMsg(m) == 0)
{
Response.Write(sbc.alertMsg("保存成功!"));
Response.Write(sbc.execScript("window.location.href='message.aspx'"));
}
else
{
Response.Write(sbc.alertMsg("保存失败!"));
}
} --------------------编程问答-------------------- 我怀疑和cs 代码没有关系 ,可能是 FreeTextBox 的问题 ,是不是要对 FreeTextBox 做一些配置啊
--------------------编程问答-------------------- 一般性的粘贴应该是没什么问题的.,.
如果你的内容是从Word文档里面复制的话,那就有问题.,.
Word本身也是自带有代码的,...
补充:.NET技术 , ASP.NET