FreeTextbox使用

在系统发邮件,新闻内容发布上要用到freetextbox,用起来是很爽的,但是感觉freetextbox中的定义菜单感觉困难,今天在网上找到了一些资料,和大家分享下

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”

Bold  加粗
BulletedList 项目符号
Copy  复制
CreateLink  插入链接
Cut   剪切
Delete  删除
DeleteTableColumn 删除一列(En)
DeleteTableRow  删除一行(En)
IeSpellCheck IE拼写检查(En 需要安装拼写检查软件)
Indent  增加缩进
InsertDate 插入日期
InsertImage 插入图片
InsertRule 插入水平线(En)
InsertTable 插入表格(En)
InsertTableColumnAfter 插入表格列在后面(En)
InsertTableColumnBefore 插入表格列在前面(En)
InsertTableRowAfter 插入表格行在后面(En)
InsertTableRowBefore 插入表格行在前面(En)
InsertTime 插入时间
Italic 斜体
JustifyCenter 居中
JustifyFull 两端对齐
JustifyLeft 左对齐
JustifyRight 右对齐
NetSpell 网络拼写检查(En)
NumberedList 编号
Outdent 减少缩进
Paste 粘贴
Print 打印
Redo  重复
RemoveFormat 删除所有格式
Save  保存(En)
StrikeThrough  删除线
SubScript 下标
SuperScript 上标
Underline 下划线
Undo  撤消
Unlink  删除链接

希望对大家有帮助

发表在 Asp.Net | 评论关闭

js全选和读出对应id和对应值

奉师命实习留校做开发,需要做一个科研项目——影像系统。授命之后开始做需求,经过近十天的努力,大概的需求浮出水面,在以后的日子里面,我会把开 发过程中的一些技术功能模块,我认为有价值贡献出来分享的,虽然很多可能是网上的功能修改而成,但是可以保证都是经过我测试,并且已经消化的知识,如果无 意中侵犯了相关原创作者版权,请与我联系(邮箱:8chf@163.com),我将及时从日志上删除,并从系统功能中除掉。

因为是今天才决定写的,所有前期的有些需求的设计和功能模块就暂时不写出来了,如果后期时间有多余,我将会渐渐的补全。

今天试验课回到宿舍后,考虑到系统在很多地方要实现gridv+checkbox选择(有些要全选)功能,就写了一个,代码如下:

aspx代码:

<asp:GridView ID=”GridView1″ runat=”server” AutoGenerateColumns=”False”
BorderWidth=”0px” DataKeyNames=”id”>
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<input id=”Checkbox2″ runat=”server” type=”checkbox” onclick=”CheckAllC(this)”/>
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID=”ItemCheckBoxC” runat=”server” />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText=”全选”>
<ItemTemplate>
<asp:Label ID=”Label1″ runat=”server” Text=’<%# Bind(“id”) %>’ Visible=”false”></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText=”名称”>

<ItemTemplate>
<asp:Label ID=”Label2″ runat=”server” Text=’<%# Bind(“username”) %>’></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

<asp:Button ID=”Button1″ runat=”server” onclick=”Button1_Click”
Text=”显示选择列id_name” />

cs代码:

</pre>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bind();
}
}
private void bind()
{
DataTable dt =  xifenfei.mssql.SqlHelper.ExecuteDataset(xifenfei.mssql.SqlHelper.Connection_test,  CommandType.Text, "select id,username from login").Tables[0];
GridView1.DataSource = dt;
GridView1.DataBind();
}
protected void Button1_Click(object sender, EventArgs e)
{
string selectid = ""; string selectname = "";
for (int i = 0; i < GridView1.Rows.Count; i++)
{
CheckBox ch = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("ItemCheckBoxC");
if (ch.Checked)
{
selectid += GridView1.DataKeys[i].Value.ToString()+";";
Label lbl = (Label)GridView1.Rows[i].FindControl("Label2");
selectname += lbl.Text+";";
}
}
Response.Write(selectid+"<br />"+selectname);
}

js代码


<script type="text/javascript">
function CheckAllC(oCheckbox)
{
var GridView1 = document.getElementById("<%=GridView1.ClientID %>");
for(i = 1;i < GridView1.rows.length; i++)
{
GridView1.rows<em>.cells[0].getElementsByTagName("INPUT")[0].checked = oCheckbox.checked;
}
}
</script> </em>

如果有分页的话,要在 GridView1.rows.length的数值上减一

发表在 JavaScript | 评论关闭

弹出div,锁定界面

如题:本来是可以用ajaxtools控件来实现,但是感觉效果不是很好,而且效率太低,所以就写了一个代码如下

js代码:

function showname()//弹出所需模块
{
var show=document.getElementById("shown");
show.style.display="";
document.getElementById("shown").style.top="20px";
document.getElementById("shown").style.left="20px";
suoding();

}
function suoding()//锁定界面

{
var sWidth,sHeight;
sWidth=document.documentElement.clientWidth //当前浏览器内部宽度
sHeight=document.documentElement.clientHeight
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
if (window.ActiveXObject)//判断ie,如果是7以下版本,采用屏幕的宽度和高度,会导致显示结果有一点滚动条
{
Sys.ie = ua.match(/msie ([\d.]+)/)[1]
if(Sys.ie<7)
{
sWidth=screen.width;//显示器宽度,和上面的宽度有一定的出入
sHeight=screen.height;
}
}
var bgObj=document.createElement("div");
bgObj.setAttribute('id','bgDiv');
bgObj.style.position="absolute";
bgObj.style.top="0";
bgObj.style.background="#cccccc";
bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,
opacity=25,finishOpacity=75";
bgObj.style.opacity="0.6";
bgObj.style.left="0";
bgObj.style.width=sWidth + "px";
bgObj.style.height=sHeight + "px";
bgObj.style.zIndex = "50";
document.body.appendChild(bgObj);
}
function closename()//关闭
{
document.getElementById("shown").style.display="none";
var bg=document.getElementById("bgDiv");
if (bg!=null) {//排除有些浏览器不能取到动态div的情况
document.body.removeChild(bg);
}

}

html代码:

<div style=”width:1000px;height:300px;background-color:blue”> <input type=”button” value=”点击” onclick=”alert(‘adfadsfd’)”></input></div>
<div style=”position:absolute”>
<a href=”#” onclick=”showname()”  >显示姓名</a>
<div id=”shown” style=”width:300px;height:200px;background-color:gray; z-index:100; position:absolute;display:none;”><a href=”#” onclick=”closename()”  >关闭</a>
</div>
<div style=”background-color:red;width:100px;height:100px;”></div>
</div>

发表在 JavaScript | 评论关闭