dynamic validators break explorer

  • Thread starter Thread starter Abraham Luna
  • Start date Start date
A

Abraham Luna

how do i stop the dynamic validators from breaking explorer
if i use a dynamic validator and move to a different control it breaks
explorer and i can type in the page when i'm not supposed to. thank you.
 
Abraham,

What do you mean by it breaks explorer? If you could give a more detailed
explanation of what you're doing and what error is occurring it would be
much easier to help.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
try this code and watch it break :)

<%@ Page Language="c#" %>
<html>
<head>
<title>Login</title>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form id="frmLogin" runat="server">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right">Employee ID:</td>
<td><asp:TextBox ID="tbEmpId" runat="server" MaxLength="3" /></td>
<td><asp:RequiredFieldValidator ID="rfvEmpId" runat="server"
ControlToValidate="tbEmpId" CssClass="texterror" Display="Dynamic"
ErrorMessage="Employee ID is required." /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><asp:TextBox ID="tbPassword" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator ID="rfvPassword" runat="server"
ControlToValidate="tbPassword" CssClass="texterror" Display="Dynamic"
ErrorMessage="Password is required." /></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

to make it break, just type something in employee id then click on the
password text box. the cursor jumps near the semi colon and you can type on
the page
 
Abraham,

Two things:

1) It didn't break for me. This makes me suspect that it has to do with your
style sheet. Since you didn't include that I can't see what you're setting
in the CssClass setting texterror. I suspect that is where the problem is.

2) As a side note I noticed that you put a table around your form tags. You
really should put all code you are adding to the page inside of the form
tags.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
sorry, i didn't test the code before i posted it, and i didn't give the
right instructions to break the page:

<%@ Page Language="c#" %>
<html>
<head>
<title>Login</title>
<style type="text/css">
<!--
..texterror {
font-weight: bold;
color: #FF0000;
}
-->
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form id="frmLogin" runat="server">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right">Employee ID:</td>
<td><asp:TextBox ID="tbEmpId" runat="server" MaxLength="3" />
<asp:regularexpressionValidator ID="revEmpId" runat="server"
ControlToValidate="tbEmpId" ErrorMessage="Invalid Employee ID."
ValidationExpression="[\d][\d][\d]" Display="Dynamic" /></td>
<td><asp:RequiredFieldValidator ID="rfvEmpId" runat="server"
ControlToValidate="tbEmpId" CssClass="texterror" Display="Dynamic"
ErrorMessage="Employee ID is required." /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><asp:TextBox ID="tbPassword" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator ID="rfvPassword" runat="server"
ControlToValidate="tbPassword" CssClass="texterror" Display="Dynamic"
ErrorMessage="Password is required." /></td>
</tr>
<tr>
<td align="center" colspan="2"><asp:Button ID="btnLogin" runat="server"
Text="btnLogin" /></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

to break the page. type a password then click the login button.
this displays the dynamic rfvEmpId. then type an id and click in the
password field. watch the cursor jump near the semi-colon and you can type
on the page :)

thanks for any help you can provide
 
Abraham,

Now I'm stumped. I copied the code you provided and ran it, and it runs just
fine...

What browser / os are you testing this with?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Abraham Luna said:
sorry, i didn't test the code before i posted it, and i didn't give the
right instructions to break the page:

<%@ Page Language="c#" %>
<html>
<head>
<title>Login</title>
<style type="text/css">
<!--
.texterror {
font-weight: bold;
color: #FF0000;
}
-->
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form id="frmLogin" runat="server">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right">Employee ID:</td>
<td><asp:TextBox ID="tbEmpId" runat="server" MaxLength="3" />
<asp:regularexpressionValidator ID="revEmpId" runat="server"
ControlToValidate="tbEmpId" ErrorMessage="Invalid Employee ID."
ValidationExpression="[\d][\d][\d]" Display="Dynamic" /></td>
<td><asp:RequiredFieldValidator ID="rfvEmpId" runat="server"
ControlToValidate="tbEmpId" CssClass="texterror" Display="Dynamic"
ErrorMessage="Employee ID is required." /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><asp:TextBox ID="tbPassword" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator ID="rfvPassword" runat="server"
ControlToValidate="tbPassword" CssClass="texterror" Display="Dynamic"
ErrorMessage="Password is required." /></td>
</tr>
<tr>
<td align="center" colspan="2"><asp:Button ID="btnLogin" runat="server"
Text="btnLogin" /></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

to break the page. type a password then click the login button.
this displays the dynamic rfvEmpId. then type an id and click in the
password field. watch the cursor jump near the semi-colon and you can type
on the page :)

thanks for any help you can provide


S. Justin Gengo said:
Abraham,

Two things:

1) It didn't break for me. This makes me suspect that it has to do with
your style sheet. Since you didn't include that I can't see what you're
setting in the CssClass setting texterror. I suspect that is where the
problem is.

2) As a side note I noticed that you put a table around your form tags.
You really should put all code you are adding to the page inside of the
form tags.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
i don't know why you can't get it to break. i'm using ie 6 and asp.net 2

S. Justin Gengo said:
Abraham,

Now I'm stumped. I copied the code you provided and ran it, and it runs
just fine...

What browser / os are you testing this with?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Abraham Luna said:
sorry, i didn't test the code before i posted it, and i didn't give the
right instructions to break the page:

<%@ Page Language="c#" %>
<html>
<head>
<title>Login</title>
<style type="text/css">
<!--
.texterror {
font-weight: bold;
color: #FF0000;
}
-->
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form id="frmLogin" runat="server">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right">Employee ID:</td>
<td><asp:TextBox ID="tbEmpId" runat="server" MaxLength="3" />
<asp:regularexpressionValidator ID="revEmpId" runat="server"
ControlToValidate="tbEmpId" ErrorMessage="Invalid Employee ID."
ValidationExpression="[\d][\d][\d]" Display="Dynamic" /></td>
<td><asp:RequiredFieldValidator ID="rfvEmpId" runat="server"
ControlToValidate="tbEmpId" CssClass="texterror" Display="Dynamic"
ErrorMessage="Employee ID is required." /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><asp:TextBox ID="tbPassword" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator ID="rfvPassword" runat="server"
ControlToValidate="tbPassword" CssClass="texterror" Display="Dynamic"
ErrorMessage="Password is required." /></td>
</tr>
<tr>
<td align="center" colspan="2"><asp:Button ID="btnLogin" runat="server"
Text="btnLogin" /></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

to break the page. type a password then click the login button.
this displays the dynamic rfvEmpId. then type an id and click in the
password field. watch the cursor jump near the semi-colon and you can
type on the page :)

thanks for any help you can provide


S. Justin Gengo said:
Abraham,

Two things:

1) It didn't break for me. This makes me suspect that it has to do with
your style sheet. Since you didn't include that I can't see what you're
setting in the CssClass setting texterror. I suspect that is where the
problem is.

2) As a side note I noticed that you put a table around your form tags.
You really should put all code you are adding to the page inside of the
form tags.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
try this code and watch it break :)

<%@ Page Language="c#" %>
<html>
<head>
<title>Login</title>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form id="frmLogin" runat="server">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right">Employee ID:</td>
<td><asp:TextBox ID="tbEmpId" runat="server" MaxLength="3" /></td>
<td><asp:RequiredFieldValidator ID="rfvEmpId" runat="server"
ControlToValidate="tbEmpId" CssClass="texterror" Display="Dynamic"
ErrorMessage="Employee ID is required." /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><asp:TextBox ID="tbPassword" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator ID="rfvPassword" runat="server"
ControlToValidate="tbPassword" CssClass="texterror" Display="Dynamic"
ErrorMessage="Password is required." /></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

to make it break, just type something in employee id then click on the
password text box. the cursor jumps near the semi colon and you can
type on the page


message Abraham,

What do you mean by it breaks explorer? If you could give a more
detailed explanation of what you're doing and what error is occurring
it would be much easier to help.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
how do i stop the dynamic validators from breaking explorer
if i use a dynamic validator and move to a different control it
breaks explorer and i can type in the page when i'm not supposed to.
thank you.
 
Hmmm,

I'm using the same.

The only difference that I can see is that I'm pasting your form code into a
Visual Studio.net page so all of my <%@ Page Language="c#" %> code is there.
Maybe you just need to add the other paramaters to that?

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false"
Inherits="LabCSharpWeb.WebForm1" %>

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Abraham Luna said:
i don't know why you can't get it to break. i'm using ie 6 and asp.net 2

S. Justin Gengo said:
Abraham,

Now I'm stumped. I copied the code you provided and ran it, and it runs
just fine...

What browser / os are you testing this with?

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Abraham Luna said:
sorry, i didn't test the code before i posted it, and i didn't give the
right instructions to break the page:

<%@ Page Language="c#" %>
<html>
<head>
<title>Login</title>
<style type="text/css">
<!--
.texterror {
font-weight: bold;
color: #FF0000;
}
-->
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form id="frmLogin" runat="server">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right">Employee ID:</td>
<td><asp:TextBox ID="tbEmpId" runat="server" MaxLength="3" />
<asp:regularexpressionValidator ID="revEmpId" runat="server"
ControlToValidate="tbEmpId" ErrorMessage="Invalid Employee ID."
ValidationExpression="[\d][\d][\d]" Display="Dynamic" /></td>
<td><asp:RequiredFieldValidator ID="rfvEmpId" runat="server"
ControlToValidate="tbEmpId" CssClass="texterror" Display="Dynamic"
ErrorMessage="Employee ID is required." /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><asp:TextBox ID="tbPassword" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator ID="rfvPassword" runat="server"
ControlToValidate="tbPassword" CssClass="texterror" Display="Dynamic"
ErrorMessage="Password is required." /></td>
</tr>
<tr>
<td align="center" colspan="2"><asp:Button ID="btnLogin"
runat="server" Text="btnLogin" /></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

to break the page. type a password then click the login button.
this displays the dynamic rfvEmpId. then type an id and click in the
password field. watch the cursor jump near the semi-colon and you can
type on the page :)

thanks for any help you can provide


message Abraham,

Two things:

1) It didn't break for me. This makes me suspect that it has to do with
your style sheet. Since you didn't include that I can't see what you're
setting in the CssClass setting texterror. I suspect that is where the
problem is.

2) As a side note I noticed that you put a table around your form tags.
You really should put all code you are adding to the page inside of the
form tags.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
try this code and watch it break :)

<%@ Page Language="c#" %>
<html>
<head>
<title>Login</title>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td align="center"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form id="frmLogin" runat="server">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td align="right">Employee ID:</td>
<td><asp:TextBox ID="tbEmpId" runat="server" MaxLength="3" /></td>
<td><asp:RequiredFieldValidator ID="rfvEmpId" runat="server"
ControlToValidate="tbEmpId" CssClass="texterror" Display="Dynamic"
ErrorMessage="Employee ID is required." /></td>
</tr>
<tr>
<td align="right">Password:</td>
<td><asp:TextBox ID="tbPassword" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator ID="rfvPassword" runat="server"
ControlToValidate="tbPassword" CssClass="texterror" Display="Dynamic"
ErrorMessage="Password is required." /></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

to make it break, just type something in employee id then click on the
password text box. the cursor jumps near the semi colon and you can
type on the page


in message Abraham,

What do you mean by it breaks explorer? If you could give a more
detailed explanation of what you're doing and what error is occurring
it would be much easier to help.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
how do i stop the dynamic validators from breaking explorer
if i use a dynamic validator and move to a different control it
breaks explorer and i can type in the page when i'm not supposed to.
thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top