我写了以下代码:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<script language="javascript">
funtion onbtn()
{
this.document.write("dsgahdhah");
}
</script>
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:LinkButton id="LinkButton1" style="Z-INDEX: 101; LEFT: 266px; POSITION: absolute; TOP: 145px" runat="server" Width="83px" Height="35px">LinkButton</asp:LinkButton>
<INPUT style="Z-INDEX: 102; LEFT: 70px; WIDTH: 117px; POSITION: absolute; TOP: 202px; HEIGHT: 24px" type="button" value="Button" onclick="onbtn" ></FONT>
</form>
</body>
</HTML>
但是按下其中按钮,没有反应,设了断点,发觉根本没有调用上面的onbtn()的函数,不知道为什么。
菜鸟太菜,请求达人解答,谢谢。
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication2.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<script language="javascript">
funtion onbtn()
{
this.document.write("dsgahdhah");
}
</script>
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:LinkButton id="LinkButton1" style="Z-INDEX: 101; LEFT: 266px; POSITION: absolute; TOP: 145px" runat="server" Width="83px" Height="35px">LinkButton</asp:LinkButton>
<INPUT style="Z-INDEX: 102; LEFT: 70px; WIDTH: 117px; POSITION: absolute; TOP: 202px; HEIGHT: 24px" type="button" value="Button" onclick="onbtn" ></FONT>
</form>
</body>
</HTML>
但是按下其中按钮,没有反应,设了断点,发觉根本没有调用上面的onbtn()的函数,不知道为什么。
菜鸟太菜,请求达人解答,谢谢。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<script language="javascript">
function onbtn()
{
this.document.write("dsgahdhah");
}
</script>
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<asp:LinkButton id="LinkButton1" style="Z-INDEX: 101; LEFT: 266px; POSITION: absolute; TOP: 145px" runat="server" Width="83px" Height="35px">LinkButton</asp:LinkButton>
<INPUT style="Z-INDEX: 102; LEFT: 70px; WIDTH: 117px; POSITION: absolute; TOP: 202px; HEIGHT: 24px" type="button" value="Button" onclick="onbtn();" ></FONT>
</form>
</body>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<script language="javascript">
funtion onbtn()
{
document.write("dsgahdhah");
}
</script>
<form id="Form1" method="post" runat="server">
<FONT face="宋体"></FONT> <INPUT style="Z-INDEX: 102; LEFT: 357px; WIDTH: 117px; POSITION: absolute; TOP: 205px; HEIGHT: 24px" type="button" value="Button" onclick="onbtn();">
<asp:LinkButton id="LinkButton1" runat="server" Width="83px" Height="35px" style="Z-INDEX: 104; LEFT: 438px; POSITION: absolute; TOP: 130px">LinkButton</asp:LinkButton>
</form>
</body>
</HTML>
这样写还是不行
funtion onbtn()
{
document.write("dsgahdhah");
}
连这都写错了,应该是
function onbtn()
{
document.write("dsgahdhah");
}