想用FreeTextBox做新闻发布,遇到一些问题,在此求助。环境:VS2008(C#),FreeTextBox是V3.2.4版本。
遇到的问题有:
1、运行时,介面FreeTextBox工具栏显示的是中文,见图一,但当鼠标点入输入框内准备输入时工具栏显示的是英文,见图二。图一:图二:
2、点击FreeTextBox工具栏的插入图片时,要人工输入路径,这样对用户很不方便,能否显示“浏览”让用户能选择路径和文件,再点上传?(见图三)图三:
附上文件源代码:
(1)Default.aspx文件源代码<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register assembly="FreeTextBox" namespace="FreeTextBoxControls" tagprefix="FTB" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test FreeTextBox</title> <style type="text/css">
.style1
{
width: 980px;
}
</style></head>
<body>
<form id="form1" runat="server">
<table align="center" cellpadding="0" cellspacing="0" class="style1">
<tr>
<td>
</td>
</tr>
<tr>
<td align="center">
<FTB:FreeTextBox ID="FreeTextBox1" runat="server"
Language="zh-CN"
>
</FTB:FreeTextBox>
</td>
</tr>
<tr>
<td align="center" height="60">
<asp:Button ID="Button1" runat="server" Height="23px" Text="保 存"
Width="93px" />
</td>
</tr>
</table>
</form>
</body>
</html>
(2)ftb.imagegallery.aspx文件源码
当关闭:return这一句时
其中:System.IO.FileInfo[] customImages = new System.IO.FileInfo[2] {defaultImages[0], defaultImages[1]};
这一句报错:“超出数组界限”<%@ Page Language="C#" ValidateRequest="false" Trace="false" %>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Import Namespace= "System.Xml " %>
<%@ Import Namespace= "System.IO " %>
<script runat="server">
protected void Page_Load(Object Src, EventArgs E) {// *** remove this return statement to use the following code ***
//return;string currentFolder = ImageGallery1.CurrentImagesFolder;// modify the directories allowed
if (currentFolder == "~/images") {// these are the default directories FTB:ImageGallery will find
string[] defaultDirectories = System.IO.Directory.GetDirectories(Server.MapPath(currentFolder),"*");// user defined custom directories
string[] customDirectories = new string[] {"folder1","folder2"};// the gallery will use these images in this instance
ImageGallery1.CurrentDirectories = customDirectories;
}
// modify the images allowed
if (currentFolder == "~/images") {System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(Server.MapPath(currentFolder));// these are the default images FTB:ImageGallery will find
System.IO.FileInfo[] defaultImages = directoryInfo.GetFiles("*");// user defined custom images (here, we're just allowing the first two)
System.IO.FileInfo[] customImages = new System.IO.FileInfo[2] {defaultImages[0], defaultImages[1]};// the gallery will use these images in this instance
ImageGallery1.CurrentImages = customImages;
} }
</script>
<html>
<head>
<title>Image Gallery</title>
</head>
<body> <form id="Form1" runat="server" enctype="multipart/form-data">
<FTB:ImageGallery id="ImageGallery1"
JavaScriptLocation="ExternalFile"
UtilityImagesLocation="ExternalFile"
SupportFolder="~/aspnet_client/FreeTextBox/"
AllowImageDelete=false AllowImageUpload=true AllowDirectoryCreate=false AllowDirectoryDelete=false runat="Server" /></form></body>
</html>
遇到的问题有:
1、运行时,介面FreeTextBox工具栏显示的是中文,见图一,但当鼠标点入输入框内准备输入时工具栏显示的是英文,见图二。图一:图二:
2、点击FreeTextBox工具栏的插入图片时,要人工输入路径,这样对用户很不方便,能否显示“浏览”让用户能选择路径和文件,再点上传?(见图三)图三:
附上文件源代码:
(1)Default.aspx文件源代码<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register assembly="FreeTextBox" namespace="FreeTextBoxControls" tagprefix="FTB" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test FreeTextBox</title> <style type="text/css">
.style1
{
width: 980px;
}
</style></head>
<body>
<form id="form1" runat="server">
<table align="center" cellpadding="0" cellspacing="0" class="style1">
<tr>
<td>
</td>
</tr>
<tr>
<td align="center">
<FTB:FreeTextBox ID="FreeTextBox1" runat="server"
Language="zh-CN"
>
</FTB:FreeTextBox>
</td>
</tr>
<tr>
<td align="center" height="60">
<asp:Button ID="Button1" runat="server" Height="23px" Text="保 存"
Width="93px" />
</td>
</tr>
</table>
</form>
</body>
</html>
(2)ftb.imagegallery.aspx文件源码
当关闭:return这一句时
其中:System.IO.FileInfo[] customImages = new System.IO.FileInfo[2] {defaultImages[0], defaultImages[1]};
这一句报错:“超出数组界限”<%@ Page Language="C#" ValidateRequest="false" Trace="false" %>
<%@ Register TagPrefix="FTB" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Import Namespace= "System.Xml " %>
<%@ Import Namespace= "System.IO " %>
<script runat="server">
protected void Page_Load(Object Src, EventArgs E) {// *** remove this return statement to use the following code ***
//return;string currentFolder = ImageGallery1.CurrentImagesFolder;// modify the directories allowed
if (currentFolder == "~/images") {// these are the default directories FTB:ImageGallery will find
string[] defaultDirectories = System.IO.Directory.GetDirectories(Server.MapPath(currentFolder),"*");// user defined custom directories
string[] customDirectories = new string[] {"folder1","folder2"};// the gallery will use these images in this instance
ImageGallery1.CurrentDirectories = customDirectories;
}
// modify the images allowed
if (currentFolder == "~/images") {System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(Server.MapPath(currentFolder));// these are the default images FTB:ImageGallery will find
System.IO.FileInfo[] defaultImages = directoryInfo.GetFiles("*");// user defined custom images (here, we're just allowing the first two)
System.IO.FileInfo[] customImages = new System.IO.FileInfo[2] {defaultImages[0], defaultImages[1]};// the gallery will use these images in this instance
ImageGallery1.CurrentImages = customImages;
} }
</script>
<html>
<head>
<title>Image Gallery</title>
</head>
<body> <form id="Form1" runat="server" enctype="multipart/form-data">
<FTB:ImageGallery id="ImageGallery1"
JavaScriptLocation="ExternalFile"
UtilityImagesLocation="ExternalFile"
SupportFolder="~/aspnet_client/FreeTextBox/"
AllowImageDelete=false AllowImageUpload=true AllowDirectoryCreate=false AllowDirectoryDelete=false runat="Server" /></form></body>
</html>
解决方案 »
- Repeater自定义表头及表尾合计
- 求一条sql语句-
- 怎样获得TreeView选中节点的Index?
- 如何实现datagrid按钮对datagrid中的内容进行编辑~没人回答+30分!两贴50分
- 如何在vs.net中响应这个事件?
- 在线考试页面怎样控制不能二次打开
- 如何获取用户上传图片的宽高??? C#
- asp通过查询access输出显示图片
- 【讨论】WCF不用证书实现自定义用户名密码验证以及WCF在IIS7上的部署
- 在类库.cs文件中不能引用System.Web空间吗?!!???????????有点急!?????????????????????????
- 求fck+dp.SyntaxHighlighter代码高亮
- asp.net中怎样在datagrid控件中显示出表中的内容,除了手动绑定数据源以外
我的可以自动上传,同时推荐 fckeditor