I'm encountering an issue with an ImageButton that has an onclientclick() method. Whenever I click the button, I receive the error Microsoft JScript runtime error: 'test' is undefined.
Below is the full code snippet:
<%@ 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>