程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> 關於C# >> ASP.NET中FreeTextBox的使用方法及代碼

ASP.NET中FreeTextBox的使用方法及代碼

編輯:關於C#
 

aspnet_client FreeTextBox的外觀文件,直接拷貝到你的工程的目錄下就可以了。

Docs 文檔嘛,就是說明文檔,只有一個幫助文件

examples 這是人家官方調試好的例子

Framework-2.0 適合.net freameork2.0使用的dll(命名空間)

Framework-1.1 適合.net freameork1.1使用的dll(命名空間)

Framework-1.0 適合.net freameork1.0使用的dll(命名空間)

只要把Framework-2.0/Framework-1.1/Framework-1.0三個中適合你用的那個dll拷貝到你工程下的bin目錄下,將

aspnet_client 拷貝到工程目錄下,然後你可以隨便的調試任何一個例子都很容易通過的。

這是一個例子:

Default.aspx

 


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" ValidateRequest="false"%>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>無標題頁</title>
</head>
<body>
<form id="Form1" runat="server">

<h2>Languages and Buttons</h2>

<div>
<asp:dropdownlist ID="ToolbarStyle" Runat="Server" />
<asp:dropdownlist ID="Language" Runat="Server" />
<asp:Button ID="ConfigureButton" Text="Configure" runat="Server" OnClick="ConfigureButton_Click" />

<br />

<FTB:FreeTextBox id="FreeTextBox1"
Focus="true"
toolbarlayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,
FontBackColorPicker|Bold,Italic,Underline,Strikethrough,Superscript,Subscript,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,
JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink,InsertImage|Cut,Copy,Paste,Delete;Undo,Redo,Print,Save|
SymbolsMenu,StylesMenu,InsertHtmlMenu|InsertRule,InsertDate,InsertTime|InsertTable,EditTable;InsertTableRowAfter,
InsertTableRowBefore,DeleteTableRow;InsertTableColumnAfter,InsertTableColumnBefore,DeleteTableColumn|InsertForm,InsertTextBox,
InsertTextArea,InsertRadioButton,InsertCheckBox,InsertDropDownList,InsertButton|InsertDiv,EditStyle,InsertImageFromGallery,
Preview,SelectAll,WordClean,NetSpell"
ImageGalleryPath = "~/image/upload"
ImageGalleryUrl = "ftb.imagegallery.aspx?rif={0}&cif={0}"
Language="zh-CN"
ToolbarStyleConfiguration="Office2003"
OnSaveClick="SaveButton_Click"
runat="Server">

</FTB:FreeTextBox>
<asp:LinkButton ID="LinkButton1" runat="server"/>
<asp:Button id="SaveButton" Text="Save" runat="server" OnClick="SaveButton_Click" />
</div>

<div>
<asp:Literal id="Output" runat="server" />

</div>
</form>

</body>
</html>


其中要注意的是,由於ASP.NET不是默認會自動產生_doPostBack方法,因此,如果采用FTB的默認Save按鈕操作,可能會報告對象不存在錯誤,因此,可以在網頁中添加一行<asp:LinkButton ID="LinkButton1" runat="server"/>來強制要求產生_doPostBack方法。Language屬性設置要求放置在toolbarlayout之後設置,否則可能產生不了效果。

Default.aspx.cs


using System;
using System.Data;
using System.Configuration;
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.Collections.Specialized;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ToolbarStyle.DataSource = Enum.GetNames(typeof(FreeTextBoxControls.ToolbarStyleConfiguration));
if (!IsPostBack)
{
FreeTextBox1.FontFacesMenuList = new string[] { "Arial", "Courier New", "Garamond", "Georgia", "Tahoma", "Times New Roman", "/"楷體_GB2312/"", "/"宋體/"", "/"黑體/"", "/"仿宋_gb2312/"", "/"隸書/"" };
FreeTextBox1.FontFacesMenuNames = new string[] { "Arial", "Courier New", "Garamond", "Georgia", "Tahoma", "Times New Roman", "楷體", "宋體", "黑體", "仿宋", "隸書"};  

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved