FCKeditor如何在FormView中的应用

来源:百度知道 编辑:UC知道 时间:2024/06/23 23:06:11
article_add.aspx代码
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" OnLoad="FormView1_Load" DefaultMode="Insert" Width="500px" DataKeyNames="id">
<InsertItemTemplate >
<table cellpadding="0" cellspacing="0" style="width: 100%">
………
<tr height="28">
<td align="center" valign="top" >文章内容</td>
<td align="left" >
<FCKeditorV2:FCKeditor ID="fckeditor1" Value='<%# bind("content") %>' Height="400px" BasePath="~/FCKeditor/" runat="server" Width="100%" />
</td> </tr>
<tr height=50>

Private Sub Form_Load() '设置程序大小
Form1.Height = 7700
Form1.Width = 11000
End Sub

Private Sub Form_Resize() '设置richtextbox属性 窗体大小改变会触发的事件
On Error Resume Next '如果出现错误,忽略错误,继续执行
RichTextBox1.Top = 900
RichTextBox1.Left = 20
RichTextBox1.Height = ScaleHeight - 40
RichTextBox1.Width = ScaleWidth - 40
End Sub

Private Sub MenuNew_Click() '新建
RichTextBox1.Text = "" '清空文本框
FileName = "未命名" '通过对话框获取的文件名为未命名
Form1.Caption = FileName
End Sub

Private Sub MenuOpen_Click() '打开
CommonDialog1.Filter = "文本文档(*.txt)|*.txt|RTF文档(*.rtf)|*.rtf|所有文件(*.*)|*.*" '文件格式
CommonDialog1.ShowOpen '显示打开文件对话框
RichTextBox1.Text = "" '清空文本框
FileName = CommonDialog1.FileName '定义文件名
R