> When you say a Submit button, do you mean <input type="submit"> ? If so,
how
would ASP.NET know when that button is clicked so that it can do the
client-side validation?
Try using an <asp:Button> and see if that fixes the problem.
John Saunders
No, all of the control are server side web control, and the following is my
code in WebPage1.aspx:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="web1.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<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">
<form id="Form1" method="post" runat="server">
<FONT face="ËÎÌå">
<asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 48px; POSITION:
absolute; TOP: 56px" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator id="RegularExpressionValidator1"
style="Z-INDEX: 103; LEFT: 216px; POSITION: absolute; TOP: 56px"
runat="server" ErrorMessage="RegularExpressionValidator"
ControlToValidate="TextBox1"
ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:Reg
ularExpressionValidator>
<asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 144px; POSITION:
absolute; TOP: 96px" runat="server"
Text="Button"></asp:Button></FONT>
</form>
</body>
</HTML>