Javascript Asp.net:Microsoft JScript运行时错误:';测试';是未定义的
我使用onclientclick()方法创建了一个Imagebutton,但当我按下按钮时,出现错误Microsoft JScript运行时错误:“test”未定义 以下是完整的代码:Javascript Asp.net:Microsoft JScript运行时错误:';测试';是未定义的,javascript,asp.net,Javascript,Asp.net,我使用onclientclick()方法创建了一个Imagebutton,但当我按下按钮时,出现错误Microsoft JScript运行时错误:“test”未定义 以下是完整的代码: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Librerian_ReviewHistory.aspx.cs" Inherits="Library.Librerian_ReviewHistory" MasterPa
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Librerian_ReviewHistory.aspx.cs"
Inherits="Library.Librerian_ReviewHistory" MasterPageFile="../user.Master" %>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script type="text/javascript">
function test()
{
window.open.('ShowUsers.aspx',null,'scrollbars=1,width=600,HEIGHT=400');
}
</script>
<fieldset>
<p>
<asp:Label ID="Label1" runat="server" Text="Username"></asp:Label>
</p>
<p>
<asp:TextBox runat="server" ID="Username" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required.">*</asp:RequiredFieldValidator>
<asp:ImageButton ID="ImageButton1" runat="server" Text="Categories" ValidationGroup="v1"
ImageUrl="~/Account/user1.jpg" OnClientClick="test();" />
</p>
</fieldset>
</asp:Content>
功能测试()
{
open.('ShowUsers.aspx',null,'scrollbars=1,width=600,HEIGHT=400');
}
*
通过运行代码,一切似乎都正常了。只需在window.open函数之后删除额外的点(.)。您的函数将顺利运行。尝试在页眉部分编写js函数。窗户后面还有点。真的谢谢。你真是一丝不苟。