当前位置:编程学习 > C#/ASP.NET >>

ASP.NET语句问题

<table style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px;"0" cellpadding="0" id="TABLE1"; language="javascript" onclick="return TABLE1_onclick()">

我运行LOGIN页面,用鼠标点任何一个地方都提示 这条语句的onclick="return TABLE1_onclick()" 出错

补充:额 页面代码中 确实没有这个函数 

然是 我注释掉之后 我输入用户名密码登陆页面没跳转啊

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="_Default" %>

<!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 id="Head1" runat="server">
<title>用户登录</title>
</head>
<body>
<form id="form1" runat="server" method="post">
<table style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px;"0" cellpadding="0" id="TABLE1"; language="javascript" onclick="return TABLE1_onclick()">
<tr>
<td style="vertical-align: middle; width: 100%; height: 100pt; background-color: #009900;
text-align: center; font-size: xx-large; font-family: 隶书; font-weight: bold;">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
欢迎使用在线考试系统 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<asp:Label ID="lblTime" runat="server" Text="Label" Font-Size="Medium" ForeColor="Red"></asp:Label></td>
</tr>
<tr>
<td style="width: 100%; height: 400pt; background-color: #33ff99;">
<table style="WIDTH: 251px; HEIGHT: 80px" borderColor="#66cc99" borderColorDark="#6699ff"
width="251" align="center" border="1">
<tr>
<td style="WIDTH: 769px; vertical-align: middle; text-align: center; font-size: x-large; font-weight: bold;" align="center">
用户登录</td>
</tr>
</table>

<table style="WIDTH: 251px; HEIGHT: 166px" borderColor="#66cc99" borderColorDark="#6699ff"
width="251" align="center" border="1">
<tr>
<td style="WIDTH: 769px; font-size: x-large;">&nbsp; 帐 户<DIV style="DISPLAY: inline; WIDTH: 70px; HEIGHT: 15px">
:</DIV>
</td>
<td style="width: 137px">&nbsp;
<asp:textbox id="txtUserID" runat="server" BorderStyle="Groove" Width="112px"></asp:textbox></td>
</tr>
<tr>
<td style="WIDTH: 769px; HEIGHT: 35px">&nbsp;
<DIV style="DISPLAY: inline; WIDTH: 70px; HEIGHT: 15px"><FONT face="宋体" style="font-size: x-large;">密
码:</FONT></DIV>
</td>
<td style="HEIGHT: 35px; width: 137px;">&nbsp;
<asp:textbox id="txtUserPwd" runat="server" BorderStyle="Groove" Width="112px" TextMode="Password"
BackColor="White"></asp:textbox></td>
</tr>
<tr>
<td style="WIDTH: 769px; HEIGHT: 26px">
<DIV style="DISPLAY: inline; WIDTH: 88px; HEIGHT: 20px; font-size: x-large;">
选择类型:</DIV>
</td>
<td style="HEIGHT: 26px; width: 137px;">&nbsp;&nbsp;
<asp:dropdownlist id="ddlType" runat="server" Width="108px">
<asp:ListItem Value="学生">学生</asp:ListItem>
<asp:ListItem Value="管理员">管理员</asp:ListItem>
</asp:dropdownlist></td>
</tr>
<tr>
<td style="WIDTH: 769px; height: 31px;">&nbsp;<FONT face="宋体">&nbsp;&nbsp;<asp:Button
ID="btnOK" runat="server" Height="24px" Text="登录" Width="59px" />
</FONT></td>
<td style="width: 137px; height: 31px;"><FONT face="宋体">&nbsp;&nbsp;&nbsp; </FONT>&nbsp;
<asp:Button ID="btnReset" runat="server" Text="重置" Width="68px" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="width: 100%; background-color: #006600; height: 100pt;">
<table id="TableInfo" border="0" cellpadding="0" cellspacing="0" style="width: 100%;
height: 100%; background-color: #0066ff;">
<tr>
<td style="height: 15%;" valign="middle">
</td>
</tr>
<tr>
<td valign="middle" style="text-align: center; font-size: x-large;"> <b>版权: WWW.EXAMINATIONONLINE.COM</b>
</td>
</tr>
<tr>
<td valign="middle" style="height: 10%;">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>

答案:去掉 language="javascript" onclick="return TABLE1_onclick()"

你单击了表格,将触发表格的单击事件。

而你就没定义事件,它当然会报错。

language="javascript" onclick="return TABLE1_onclick()"

这句表明你调用了javascript,首先确认你的TABLE1_onclick函数是否存在,

然后再看函数的对象名称是不是弄错了!

为了更好的弄清楚你的问题,你可以把整个文档内容贴上来!!!

你的TABLE1_onclick()函数在哪?有定义吗?
TABLE1_onclick 没这个函数
return TABLE1_onclick() 这里面应该有问题吧。。 详情了

如果函数没错的话,把这句:

<table style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px;"0" cellpadding="0" id="TABLE1"; language="javascript" onclick="return TABLE1_onclick()">

改成:<table style="width: 100%; height: 100%; position: absolute; left: 0px; top: 0px;"0" cellpadding="0" id="TABLE1"; language="onclick="return TABLE1_onclick()">

上一个:asp.net怎么学?
下一个:如何学习asp.net

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,