<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %><!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>无标题页</title>
<style type="text/css">
.boderBottom
{
border-bottom: green thin solid;
border-right: 0px solid;
border-top: 0px solid;
border-left: 0px solid;
}
</style> <script type="text/javascript">
function changeStyle(id)
{
var textBox = document.getElementById(id);
textBox.className = "boderBottom"
textBox.disabled = true;
}
function helloWorld(){
alert('Hello World');
}
</script></head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input id="Button1" type="button" value="button" onclick="changeStyle('TextBox1')" runat="server"/>
<asp:Button ID="Button2" runat="server" Text="Button" OnClientClick="changeStyle('TextBox1')"/>
<asp:Button ID="Button3" runat="server" Text="Button" OnClientClick="helloWorld()"/>
</div>
</form>
</body>
</html>Button1可以实现changeStyle的效果 为什么Button2不能?
解决方案 »
- javascript+Div+分页功能的实现
- Flex3中的ConvolutionFilter类,参数个数问题!!!
- ext 动态异步加载的树
- 求助 如何获得鼠标下面的dom对象
- 考试系统中,如何实现规定考试时间
- jscript在IE下运行正常但到firefox下就死掉了
- 在哪可以找到MSN API的说明书呀,急!急!呀
- 双击图片,弹出保存图片的对话框,怎么做?
- 非常棘手的问题,关于body的onUnload事件,高分恳请帮助<br>
- 急急急!!!!开机不能进入WINDOWS窗口,出现一页乱码.
- 在IT行业中现在的发展最火的是那些?未来五年有什么趋势
- 这个折叠菜单怎样变成可以同时展开多个节点?
OnClientClick你去看看这2个的区别。。自然就懂了
OnClentClick会使页面回送 Button1后面有 runat="server" 它不会使页面回送?
执行完js表单就提交了 return false阻止提交