修改 html 标签属性
修改 checked 属性
var sex = '${entity.sex}';
if(sex == '男')
{
//document.all.sexCk1.checked=true; 这种火狐不支持
document.getElementById('sexCk1').checked = true;
document.getElementById('sexCk2').checked = false;
}else if(sex == '女'){
document.getElementById('sexCk1').checked = false;
document.getElementById('sexCk2').checked = true;
}
修改 class 属性
// 处理课程进度
var progress = '<s:property value="progress" /> ';
//alert(' progress :'+progress);
if(progress >= 1){
document.getElementById('javase').className = 'passed';
}
if(progress >= 2){
document.getElementById('web').className = 'passed';
}
if(progress >= 3){
&nb
相关文档:
前台 <form id="form1" runat="server" enctype="multipart/form-data">
<input type="flie" id="xxx">
</form>
后台通过 HttpPostedFile f = Request.Files["xxx"]
接收就可以了 ......
有时页面需要获得用户浏览器的高度才能确定内容显示在哪里,代码
<div style="position:absolute; left:0; top:expression(document.body.clientHeight/2-document.body.clientHeight/4)">
</div>
中,expression(document.body.clientHeight/2)即为获得浏览器高度再除以2 ......
StringBuilder sb = new StringBuilder();
Server.Execute("~/Default2.aspx", new StringWriter(sb));
File.WriteAllText(Server.MapPath("index.htm"), sb.ToString()); ......
最近在弄公司的系统时遇到一个问题,有一个winform要调用网站的数据库,数据库中存的是经过eWebEditor处理过的文章,都带有html标签,当时想用正则表达式过滤掉,但是还是放弃了原因有三:1.我对正则表达式了解很少;2.虽说我可以现学正则表达式,但是实现起来也是很麻烦的;3.如果过滤掉的话文章的格式就没有了。于 ......
//截取部分内容方法
public static string strvalue(string value, int length)
{
string strValue = NoHTML(value);// 去除HTML标记
&nb ......