Control the position of a CustomValidator

M

Mr. X.

Hello.

How can I control the position of customValidator.

I have code like this (ASP.NET)
<asp:CustomValidator dir = "rtl" CHARSET=WINDOWS-1255"
id = "email_err"
ControlToValidate="a_email"
OnServerValidate="checkEmail"
Text="..."
ErrorMessage="..."
runat="server" />

in CSS I have declared :

#email_err
{
position: absolute;
top:290px;
left:230px;
width:220px;
visibility:visible;
font-size:16pt;
font-weight:bold;
color:red;
}

But, I see that the customValidator's position is not at the position of
CSS.

I want a sample for that, please.

Thanks :)
 
N

Norm

Hello.

How can I control the position of customValidator.

I have code like this (ASP.NET)
<asp:CustomValidator dir = "rtl" CHARSET=WINDOWS-1255"
  id = "email_err"
  ControlToValidate="a_email"
  OnServerValidate="checkEmail"
  Text="..."
  ErrorMessage="..."
runat="server" />

in CSS I have declared :

#email_err
{
  position: absolute;
  top:290px;
  left:230px;
  width:220px;
  visibility:visible;
  font-size:16pt;
  font-weight:bold;
  color:red;

}

But, I see that the customValidator's position is not at the position of
CSS.

I want a sample for that, please.

Thanks :)

The client id of the custom validator is most likely not "email_err".
The ids of server controls are determined not only by their id, but by
all of their parent's ids. "View Source" on your page to see the
actual id. However, a better solution is to just use a css class
instead of id. Try this:

I have code like this (ASP.NET)
<asp:CustomValidator dir = "rtl" CHARSET=WINDOWS-1255"
id = "email_err"
ControlToValidate="a_email"
OnServerValidate="checkEmail"
Text="..."
ErrorMessage="..."
CssClass="email_err"
runat="server" />

in CSS I have declared :

..email_err
{
position: absolute;
top:290px;
left:230px;
width:220px;
visibility:visible;
font-size:16pt;
font-weight:bold;
color:red;

}
 

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top