I've narrowed down the code sample to use. I've cut'n'paste the code from
VS, so it's a bit wonky, sorry, but I hope it'll give you an idea I'm not
doing anything funky. Please don't tell me it's an IIS6 validator control
handling bug. I left j2ee to get away from that crap with different
solutions on different platforms. :< But it's looking like it works with
IIS under XP and behaves differently (broken) under win2k3server and IIS6.
Any ideas are greatly appreciated. Thanks.
Here's the html
<%@ Page language="c#" Codebehind="test.aspx.cs" AutoEventWireup="false"
Inherits="PCHenry.test" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>test</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="FlowLayout">
<form id="Form1" method="post" runat="server">
<P><asp:Label id="Label1" runat="server">Label</asp:Label><asp:TextBox
id="TextBox1" runat="server"></asp:TextBox><asp:RequiredFieldValidator
id="RequiredFieldValidator1" runat="server"
ErrorMessage="RequiredFieldValidator"
ControlToValidate="TextBox1"></asp:RequiredFieldValidator><asp:Button
id="Button1" runat="server" Text="Button"></asp:Button></P>
<P> </P>
<P><asp:Label id="Label2" runat="server">Label</asp:Label></P>
</form>
</body>
</HTML>
And here's the C# codebehind
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace PCHenry
{
/// <summary>
/// Summary description for test.
/// </summary>
public class test : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.RequiredFieldValidator
RequiredFieldValidator1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Label Label2;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
Label2.Text = TextBox1.Text;
if( TextBox1.Text == null )
{
Label2.Text = "<NULL>";
}
else if( TextBox1.Text == "")
{
Label2.Text = "<empty>";
}
Label2.Text += ", RequiredFieldValidator1.IsValid=" +
RequiredFieldValidator1.IsValid;
}
}
}