|
在官方默认的版本中,FCKeditor是不支持asp.net的(没有供asp.net调用的接口),不过有一个供asp调用的接口,我根据fckeditor.asp这个文件用C#改写了一个.Net的接口,大家有需要可以参考。
<script language="c#" runat="Server"> public class FCKeditor { private string sBasePath; private string sInstanceName; private string sWidth; private string sHeight; private string sToolbarSet; private string sValue;
private ArrayList oConfig;
public FCKeditor() { sBasePath = "/admin/FCKeditor/"; sWidth = "100%"; sHeight = "200"; sToolbarSet = "Default"; sValue = ""; oConfig = new ArrayList(); }
public string BasePath { get{ return sBasePath; } set{ sBasePath = value; } }
public string InstanceName { get{ return sInstanceName; } set{ sInstanceName = value; } }
public string Width { get{ return sWidth; } set{ sWidth = value; } }
public string Height { get{ return sHeight; } set{ sHeight = value; } }
public string ToolbarSet { get{ return sToolbarSet; } set{ sToolbarSet = value; } }
public string Value { get{ return sValue; } set{ sValue = value; } }
public void Config(string configKey, string configValue) { oConfig.Add(new DictionaryEntry(configKey, configValue)); }
public void Create(string instanceName) { HttpContext.Current.Response.Write(""); if(IsCompatible()) { string sFile=""; string sLink=""; if(HttpContext.Current.Request["fcksource"] == "true"){ sFile = "fckeditor.original.html";} else{ sFile = "fckeditor.html"; }
sLink = sBasePath + "editor/" + sFile + "?InstanceName=" + instanceName;
if(sToolbarSet != "") sLink = sLink + "&Toolbar="+sToolbarSet;
HttpContext.Current.Response.Write(""); } else { string sWidthCSS=""; string sHeightCSS=""; if(sWidth.IndexOf('%')!=-1){ sWidthCSS = sWidth; }
上一篇:无需软件 Vista自动更换IP地址
下一篇:修改注册表 缩短Vista响应时间
|