时间:2021-07-01 10:21:17 帮助过:13人阅读
//直接在js中写
<script language="javascript">
function EnterTextBox()
{
if(event.keyCode == 13 && document.all["TextBox1"].value != "")
{
event.keyCode = 9;
event.returnValue = false;
document.all["TextBox1"].click();
}
}
</script>
<body onkeypress="return EnterTextBox()">
//此处TextBox1为页面上TextBox的ID
<script language="javascript">
function EnterTextBox(button)
{
if(event.keyCode == 13 && document.all["TextBox1"].value != "")
{
event.keyCode = 9;
event.returnValue = false;
document.all[button].click();
}
}
</script>
在PageLoad事件里
代码如下:
TextBox1.Attribute.add("onkeypress","EnterTextBox('Button1')");
数据库取图片在img显示
假如你数据库里存放的都是图片文件名.
在你本地图片的路径是Image
则可以使用如下代码:
代码如下:
<img src="<%# Eval("ImageName","image/{0}")>"
图片高亮显示
代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script language="javascript"><!--
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=70
else
cur.filters.alpha.opacity=100
}
</script>
<img src="//www.gxlcms.com/images/logo.gif" style="filter:alpha(opacity=100)" onmouseover="makevisible(this,0)" onmouseout="makevisible(this,1)">
</body>
</html>